pub enum DefaultValue {
Any(Option<Lit>),
Flag,
Str(Option<&'static str>),
String(Option<String>),
ByteStr(Option<&'static [u8]>),
ByteString(Option<Vec<u8>>),
Byte(Option<u8>),
Char(Option<char>),
I32(Option<i32>),
F32(Option<f32>),
Bool(Option<bool>),
Idents,
}Expand description
a default value for a Def
Variants§
Any(Option<Lit>)
any literal
Flag
a flag that doesn’t have a value eg #[my_input(enabled)]
Str(Option<&'static str>)
a string
String(Option<String>)
a string
ByteStr(Option<&'static [u8]>)
a bytestring
ByteString(Option<Vec<u8>>)
a bytestring
Byte(Option<u8>)
a u8
Char(Option<char>)
a char
I32(Option<i32>)
a i32
F32(Option<f32>)
a f32
Bool(Option<bool>)
a bool
Idents
a list of idents (default not supported)
Implementations§
Source§impl DefaultValue
impl DefaultValue
Trait Implementations§
Source§impl Clone for DefaultValue
impl Clone for DefaultValue
Source§fn clone(&self) -> DefaultValue
fn clone(&self) -> DefaultValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl From<&DefaultValue> for Types
impl From<&DefaultValue> for Types
Source§fn from(value: &DefaultValue) -> Self
fn from(value: &DefaultValue) -> Self
Converts to this type from the input type.
Source§impl From<DefaultValue> for Option<Lit>
impl From<DefaultValue> for Option<Lit>
Source§fn from(val: DefaultValue) -> Self
fn from(val: DefaultValue) -> Self
Converts to this type from the input type.
Source§impl ToTokens for DefaultValue
impl ToTokens for DefaultValue
Source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
Source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
Auto Trait Implementations§
impl Freeze for DefaultValue
impl RefUnwindSafe for DefaultValue
impl !Send for DefaultValue
impl !Sync for DefaultValue
impl Unpin for DefaultValue
impl UnsafeUnpin for DefaultValue
impl UnwindSafe for DefaultValue
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<T> Spanned for Twhere
T: Spanned + ?Sized,
impl<T> Spanned for Twhere
T: Spanned + ?Sized,
Source§fn span(&self) -> Span
fn span(&self) -> Span
Returns a
Span covering the complete contents of this syntax tree
node, or Span::call_site() if this node is empty.