Attribute Macro pin_init::pin_init[][src]

#[pin_init]
Expand description

Mark a type as being init_pin!-able.

Can only be applied to structs. Each field can be tagged with #[pin] or not. Tagged fields are pin-initialized, and untaged fields are initialized by value like they do in normal struct expression.

#[pin_init]
struct ManyPin {
    #[pin]
    a: NeedPin,
    b: usize,
}

Also works for tuple-structs:

#[pin_init]
struct ManyPin(#[pin] NeedPin, usize);

You could apply it to unit-structs (but probably not very useful):

#[pin_init]
struct NoPin;