| 1 | use rgbrust-analyzer cargo rgb 0.8.53 crate/::*; |
| 2 | |
| 3 | // Run using: cargo run --features=serde --example serde |
| 4 | |
| 5 | fn mainrust-analyzer cargo rgb 0.8.53 main().() { |
| 6 | let color = Rgbrust-analyzer cargo rgb 0.8.53 formats/rgb/Rgb# { rrust-analyzer cargo rgb 0.8.53 formats/rgb/Rgb#r.:255_u8, grust-analyzer cargo rgb 0.8.53 formats/rgb/Rgb#g.:0, brust-analyzer cargo rgb 0.8.53 formats/rgb/Rgb#b.:100 }; |
| 7 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("{}", serde_jsonrust-analyzer cargo serde_json 1.0.145 crate/::to_stringrust-analyzer cargo serde_json 1.0.145 ser/to_string().(&color).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().()); |
| 8 | |
| 9 | let color: Rgbrust-analyzer cargo rgb 0.8.53 formats/rgb/Rgb#<u8> = serde_jsonrust-analyzer cargo serde_json 1.0.145 crate/::from_strrust-analyzer cargo serde_json 1.0.145 de/from_str().("{\"r\":10,\"g\":20,\"b\":30}").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 10 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("{}", color); |
| 11 | } |