File tree 6 files changed +51
-21
lines changed
notes/language/rust/crates
6 files changed +51
-21
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ title : Chrono
3
+ ref : https://docs.rs/chrono/latest/chrono/index.html
4
+ ---
5
+
6
+ ## Install
7
+
8
+ Perform operations on dates and times.
9
+
10
+ ``` shell
11
+ cargo add chrono
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ Print current datetime in an arbitrary format:
17
+
18
+ ``` rust
19
+ use chrono :: prelude :: * ;
20
+
21
+ fn main () {
22
+ let now : DateTime <Local > = Local :: now ();
23
+ println! (" {}" , now . format (" %Y-%m-%d %H:%M:%S" ));
24
+ }
25
+ ```
Original file line number Diff line number Diff line change @@ -3,14 +3,16 @@ title: Clap
3
3
ref : https://docs.rs/clap/latest/clap/_derive/_tutorial/chapter_0/index.html
4
4
---
5
5
6
- ## Usage
6
+ ## Install
7
7
8
- Command Line Argument Parser for Rust .
8
+ Command line argument parser .
9
9
10
10
``` shell
11
11
cargo add -F derive clap
12
12
```
13
13
14
+ ## Usage
15
+
14
16
Example of program with 3 available arguments:
15
17
16
18
- ` -r/--random ` boolean
Original file line number Diff line number Diff line change @@ -3,22 +3,17 @@ title: Iced
3
3
ref : https://book.iced.rs/first-steps.html
4
4
---
5
5
6
- ## Basic
6
+ ## Install
7
7
8
- A very simple example of a working GUI application
9
- (using the unreleased v0.13.0 as for 2024/08/17):
8
+ Create GUI applications.
10
9
11
- ` Cargo.toml `
10
+ ``` shell
11
+ cargo add iced
12
+ ```
12
13
13
- ``` toml
14
- [package ]
15
- name = " sample"
16
- version = " 0.1.0"
17
- edition = " 2021"
14
+ ## Usage
18
15
19
- [dependencies ]
20
- iced = { git = " https://github.com/iced-rs/iced.git" } # "0.13.0"
21
- ```
16
+ A very simple example using v0.13.0:
22
17
23
18
` src/main.rs `
24
19
Original file line number Diff line number Diff line change @@ -3,14 +3,16 @@ title: Rand
3
3
ref : https://rust-lang-nursery.github.io/rust-cookbook/algorithms/randomness.html
4
4
---
5
5
6
- ## Usage
6
+ ## Install
7
7
8
- Utilities to generate random numbers in Rust .
8
+ Generate random numbers.
9
9
10
10
``` shell
11
11
cargo add rand
12
12
```
13
13
14
+ ## Usage
15
+
14
16
Generate a random number within a range:
15
17
16
18
``` rust
Original file line number Diff line number Diff line change @@ -3,15 +3,17 @@ title: Reqwest
3
3
ref : https://docs.rs/reqwest/latest/reqwest/index.html
4
4
---
5
5
6
- ## Blocking
6
+ ## Install
7
7
8
- The simplest way to make a request is by making a blocking request .
8
+ Make HTTP requests .
9
9
10
10
``` shell
11
- cargo add -F blocking reqwest
11
+ cargo add -F blocking reqwest # For blocking requests
12
12
```
13
13
14
- Simple example using ` v0.12.7 ` :
14
+ ## Blocking
15
+
16
+ Simple example using v0.12.7:
15
17
16
18
``` rust
17
19
fn main () -> Result <(), Box <dyn std :: error :: Error >> {
Original file line number Diff line number Diff line change @@ -3,12 +3,16 @@ title: Serde JSON
3
3
ref : https://docs.rs/serde_json/latest/serde_json/enum.Value.html
4
4
---
5
5
6
- ## Untyped JSON
6
+ ## Install
7
+
8
+ Manipulate JSON.
7
9
8
10
``` shell
9
11
cargo add serde_json
10
12
```
11
13
14
+ ## Untyped JSON
15
+
12
16
Instantiate a JSON:
13
17
14
18
``` rust
You can’t perform that action at this time.
0 commit comments