Crate Serde
Chester Wyke January 06, 2023 Updated: April 15, 2025 #rust
rust (Series)
Conditional Compilation
Install
Crate Serde
References
Cargo
Toolchain (Nightly)
String Formatting
Time
Crate Tokio
Publish Crate
rustfmt
Single file script
Snippets
CI
Pattern Type State
WASM
Create New Crate
Documentation
JSON
Pattern Builder
Testing
Working with collections of bytes
Thoughts about rust
Are we yet
OnceLock
Crate Actix Web
Stack Overflow
Crate Clap
Crate Poll Promise
Crate Insta
Tips
Create new egui project
Crate CSV
Crate egui
Iterators
Crate Tracing Subscriber
Regex
vscode
Enum Conversion
Macros
lettre
Google APIs
Conditional Compilation
Install
Crate Serde
References
Cargo
Toolchain (Nightly)
String Formatting
Time
Crate Tokio
Publish Crate
rustfmt
Single file script
Snippets
CI
Pattern Type State
WASM
Create New Crate
Documentation
JSON
Pattern Builder
Testing
Working with collections of bytes
Thoughts about rust
Are we yet
OnceLock
Crate Actix Web
Stack Overflow
Crate Clap
Crate Poll Promise
Crate Insta
Tips
Create new egui project
Crate CSV
Crate egui
Iterators
Crate Tracing Subscriber
Regex
vscode
Enum Conversion
Macros
lettre
Google APIs
Tips and Tricks for working with Serde
.
Attributes
Website: https://serde.rs/attributes.html
Specially noted Container attributes
#[serde(rename_all = "lowercase")]
Default - Use default for any missing fields
#[serde(default)]
Specially noted Field attributes
#[serde(rename = "name")]
#[serde(alias = "name")]
Path - Use callable to set default value if field not found. This may also be a trait method.
#[serde(default = "path")]
Default - Use Default::default()
if not present. See
also default value for a field
#[serde(default)]
Enums and TOML
Using #[serde(tag = "type")]
can sometimes resolve Err value: UnsupportedType
errors
Transcoding
Source: https://serde.rs/transcode.html
Going from any self describing format to any other self describing format (Not tested yet, but wanted to be able to find it next time)
use io;