Crates.io | partial_derive2 |
lib.rs | partial_derive2 |
version | 0.4.3 |
source | src |
created_at | 2023-06-11 08:00:10.485772 |
updated_at | 2024-06-08 07:24:47.275765 |
description | makes all the properties of a struct type an optional property |
homepage | |
repository | https://github.com/mbecker20/partial_derive2 |
max_upload_size | |
id | 887287 |
size | 4,766 |
Like Partial<T>
of TypeScript
, makes all the properties of a struct type an optional property.
Provides Partial
derive macro.
#[derive(Partial, Clone)]
#[partial_derive(Clone)]
struct SomeStruct {
pub field_one: i32,
field_two: Vec<bool>,
}
generates
#[derive(Clone)]
struct PartialSomeStruct {
pub field_one: Option<i32>,
field_two: Option<Vec<bool>>,
}