[][src]Trait destruct_lib::Destruct

pub trait Destruct: Sized {
    type DestructType: From<Self> + Into<Self>;
    fn destruct(self) -> Self::DestructType;
fn construct(d: Self::DestructType) -> Self; }

Associated Types

type DestructType: From<Self> + Into<Self>

The destructed object type

If your struct is:

#[derive(Destruct)]
struct YourStruct {
    field: YourField,
    field2: YourField2,
}

Then the DestructType is:

DestructBegin<Fields, m> where Fields = DestructField<YourField, NextField, m1> NextField = DestructField<YourField2, End, m2> End = DestructEnd where m is some generated type implementing trait DestructMetadata m1 is the metadata for field, implementing trait DestructFieldMetadata m2 is the metadata for field2, implementing trait DestructFieldMetadata }

Loading content...

Required methods

fn destruct(self) -> Self::DestructType

Destruct self to destruct type

fn construct(d: Self::DestructType) -> Self

Construct self from destruct type

Loading content...

Implementors

Loading content...