pub enum Occurs {
None,
Single,
Optional,
DynamicList,
StaticList(usize),
}
Expand description
Defines the occurrence (how often the field is used) of a field in a specific type.
Variants§
None
The field is not used at all.
Single
The field is used exactly one time.
Optional
The field is used optional (zero or exactly one time).
DynamicList
The field is used as a dynamic list.
StaticList(usize)
The field is used as a list with a fixed size.
Implementations§
Source§impl Occurs
impl Occurs
Sourcepub fn make_type(
self,
ident: &TokenStream,
need_indirection: bool,
) -> Option<TokenStream>
pub fn make_type( self, ident: &TokenStream, need_indirection: bool, ) -> Option<TokenStream>
Wrapped the passed type ident
into a suitable rust type depending on
the occurrence and the need of indirection (boxing).
§Examples
Occurs::Single
will return the type as is, or asBox<T>
Occurs::Optional
will return the type asOption<T>
Occurs::DynamicList
will return the type asVec<T>
Occurs::StaticList
will return the type as array[T; SIZE]
Trait Implementations§
impl Copy for Occurs
impl Eq for Occurs
impl StructuralPartialEq for Occurs
Auto Trait Implementations§
impl Freeze for Occurs
impl RefUnwindSafe for Occurs
impl Send for Occurs
impl Sync for Occurs
impl Unpin for Occurs
impl UnwindSafe for Occurs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.