Crates.io | serde-big-array-options |
lib.rs | serde-big-array-options |
version | 0.1.1 |
source | src |
created_at | 2023-10-22 10:52:15.51652 |
updated_at | 2023-10-22 20:31:34.582191 |
description | Allow to serialize/deserialize [Option |
homepage | |
repository | https://github.com/nbittich/serde-big-array-options |
max_upload_size | |
id | 1010508 |
size | 3,231 |
Simpler alternative to serde_with.
If you need something more than [Option<T>;N]
, use that instead.
const DECK_SIZE:usize = 52;
#[derive(Debug, Copy, Clone, Serialize, Deserialize)]
pub struct Game {
#[serde(
serialize_with = "serde_big_array_options::serialize",
deserialize_with = "serde_big_array_options::deserialize"
)]
pub back_in_deck: [Option<usize>; DECK_SIZE],
}