enum DiplomatStructAttribute {
Out,
Opaque,
OpaqueMut,
}
Expand description
Custom Diplomat attribute that can be placed on a struct definition.
Variants§
Out
The #[diplomat::out]
attribute, used for non-opaque structs that
contain an owned opaque in the form of a Box
.
Opaque
The #[diplomat::opaque]
attribute, used for marking a struct as opaque.
Note that opaque structs can be borrowed in return types, but cannot
be passed into a function behind a mutable reference.
OpaqueMut
The #[diplomat::opaque_mut]
attribute, used for marking a struct as
opaque and mutable.
Note that mutable opaque structs can never be borrowed in return types
(even immutably!), but can be passed into a function behind a mutable
reference.
Implementations§
source§impl DiplomatStructAttribute
impl DiplomatStructAttribute
sourcefn parse(attrs: &[Attribute]) -> Result<Option<Self>, Vec<Self>>
fn parse(attrs: &[Attribute]) -> Result<Option<Self>, Vec<Self>>
Parses a DiplomatStructAttribute
from an array of syn::Attribute
s.
If more than one kind is found, an error is returned containing all the
ones encountered, since all the current attributes are disjoint.