Skip to main content

optional

Attribute Macro optional 

Source
#[optional]
Expand description

Specify that a property value of None should not be captured, instead of being captured as null.

§Syntax

This macro doesn’t accept any arguments.

§Applicable to

This attribute can be applied to properties where the type is Option<&T>.