forked from devsonket/devsonket.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrust.json
More file actions
151 lines (151 loc) · 6.44 KB
/
Copy pathrust.json
File metadata and controls
151 lines (151 loc) · 6.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
{
"id": "rustlang",
"title": "রাস্ট",
"slug": "rustlang",
"description": "রাস্ট হচ্ছে মেমরি সেইফ কম্পাইলড্ ল্যাংঙ্গুয়েজ যার পারফর্মেন্স সি/সি++ এর কাছাকাছি বা কখনো কখনো তাদের থেকে ভালো",
"colorPref": "#CE412B",
"contents": [{
"title": "কার্গো",
"items": [{
"definition": "নতুন প্রজেক্ট তৈরি করা",
"code": "cargo init YOUR_PROJECT"
},
{
"definition": "কোনো CLI ইন্সটল করা",
"code": "cargo install YOUR_CLI"
},
{
"definition": "git ছাড়া প্রজেক্ট তৈরি করা",
"code": "cargo init YOUR_PROJECT --vcs none"
},
{
"definition": "কারেন্ট ডাইরেক্টরিতে প্রজেক্ট তৈরি করা",
"code": "cargo init ."
},
{
"definition": "প্রজেক্ট বিল্ড করা(debug)",
"code": "cargo build"
},
{
"definition": "প্রজেক্ট বিল্ড করা(release)",
"code": "cargo build --release"
},
{
"definition": "টেস্ট রান করা",
"code": "cargo test"
},
{
"definition": "প্রজেক্ট রান করা(debug)",
"code": "cargo run"
},
{
"definition": "প্রজেক্ট রান করা(release)",
"code": "cargo run --release"
},
{
"definition": "অন্য টার্গেট এর জন্য কম্পাইল করা",
"code": "cargo build --target=YOUR-TARGET"
},
{
"definition": "প্রজেক্টের docs জেনারেট করা",
"code": "cargo doc"
}
]
},
{
"title": "Cargo.toml",
"items": [{
"definition": "কোনো ডিপেন্ডেন্সির নামসহ ভার্সন",
"code": "CRATE = \"CRATE_VERSION\""
},
{
"definition": "ক্রেটের নির্দিষ্ট ফিচার ব্যবহার করা",
"code": "CRATE = { version = \"VERSION\", features = [\"FEATURE-1\"] }"
},
{
"definition": "লিংক টাইম অপ্টিমাইজেশন ব্যবহার করা(release বিল্ড)",
"code": "[profile.release]\nlto=true"
},
{
"definition": "লিংক টাইম অপ্টিমাইজেশন ব্যবহার করা(debug বিল্ড)",
"code": "[profile.debug]\nlto=true"
}
]
},
{
"title": "rustup",
"items": [{
"definition": "nightly toolchain ব্যবহার করা",
"code": "rustup default nightly"
},
{
"definition": "toolchain আপডেট করা",
"code": "rustup update toolchain"
},
{
"definition": "Target ইনস্টল করা",
"code": "rustup target add TARGET"
}
]
},
{
"title": "বিভিন্ন রিসোর্স",
"items": [{
"definition": "The Book",
"code": "https://docs.rust-lang.org/book"
},
{
"definition": "Package registry",
"code": "https://crates.io"
},
{
"definition": "Crates documentations",
"code": "https://docs.rs"
}
]
},
{
"title": "Traits",
"items": [{
"definition": "আর্গুমেন্টে String এবং str দুটাই অ্যালাউ করা",
"code": "fn the_function(arg: impl AsRef<str>) {\n\t//do something\n}"
},
{
"definition": "struct এর জন্য কোনো trait ইমপ্লিমেন্ট করা",
"code": "impl SomeTrait for SomeStruct {\n\t// Trait stuff here\n}"
},
{
"definition": "trait ডিক্লেয়ার করা",
"code": "trait SomeTrait {\n\t// Your trait stuff here\n}"
}
]
},
{
"title": "টেস্টিং",
"items": [{
"definition": "টেস্ট মডিউল",
"code": "#[cfg(test)]\nmod test{\n\t#[test]\n\tfn test() {\n\t\tassert_eq!(2+2, 4);\n\t}\n}"
}]
},
{
"title": "General",
"items": [{
"definition": "Panicking",
"code": "panic!(\"Houston, we have a problem\");"
},
{
"definition": "Match",
"code": "match Somestuff {\n\t2 => println!(\"It's 2!\"),\n\t_ => println!(\"It's something else\")\n}"
},
{
"definition": "Struct",
"code": "struct SomeStruct {\n\tsome_private_value: String,\n\tpub some_public_value: u64\n}"
},
{
"definition": "Implementing struct",
"code": "impl SomeStruct {\n\tpub fn new() {}\n}"
}
]
}
]
}