partial_derive2

Crates.iopartial_derive2
lib.rspartial_derive2
version0.4.2
sourcesrc
created_at2023-06-11 08:00:10.485772
updated_at2024-05-10 08:47:08.373044
descriptionmakes all the properties of a struct type an optional property
homepage
repositoryhttps://github.com/mbecker20/partial_derive2
max_upload_size
id887287
size4,816
(MoghTech)

documentation

https://docs.rs/partial_derive2

README

partial_derive

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>>,
}
Commit count: 26

cargo fmt