Crates.io | partial_derive |
lib.rs | partial_derive |
version | 0.1.0 |
source | src |
created_at | 2022-03-21 09:35:53.229519 |
updated_at | 2022-03-21 09:35:53.229519 |
description | makes all the properties of a struct type an optional property |
homepage | |
repository | https://github.com/rise0chen/partial_derive |
max_upload_size | |
id | 553988 |
size | 4,825 |
Like Partial<T>
of TypeScript
, makes all the properties of a struct type an optional property.
Provides Partial
derive macro.
#[derive(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>>,
}