pub struct FromVariantOptions {
pub base: OuterFrom,
pub discriminant: Option<Ident>,
pub fields: Option<Ident>,
pub supports: Option<DataShape>,
}
Fields§
§base: OuterFrom
§discriminant: Option<Ident>
The field on the deriving struct into which the discriminant expression
should be placed by the derived FromVariant
impl.
fields: Option<Ident>
§supports: Option<DataShape>
Implementations§
source§impl FromVariantOptions
impl FromVariantOptions
pub fn new(di: &DeriveInput) -> Result<Self>
Trait Implementations§
source§impl Clone for FromVariantOptions
impl Clone for FromVariantOptions
source§fn clone(&self) -> FromVariantOptions
fn clone(&self) -> FromVariantOptions
Returns a copy 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 Debug for FromVariantOptions
impl Debug for FromVariantOptions
source§impl<'a> From<&'a FromVariantOptions> for FromVariantImpl<'a>
impl<'a> From<&'a FromVariantOptions> for FromVariantImpl<'a>
source§fn from(v: &'a FromVariantOptions) -> Self
fn from(v: &'a FromVariantOptions) -> Self
Converts to this type from the input type.
source§impl ParseAttribute for FromVariantOptions
impl ParseAttribute for FromVariantOptions
source§impl ParseData for FromVariantOptions
impl ParseData for FromVariantOptions
source§fn parse_field(&mut self, field: &Field) -> Result<()>
fn parse_field(&mut self, field: &Field) -> Result<()>
Apply the next found struct field to the object, returning an error
if parsing goes wrong.
source§fn validate_body(&self, errors: &mut Accumulator)
fn validate_body(&self, errors: &mut Accumulator)
Perform validation checks that require data from more than one field or variant.
The default implementation does no validations.
Implementors can override this method as appropriate for their use-case.
fn parse_body(self, body: &Data) -> Result<Self>
source§impl ToTokens for FromVariantOptions
impl ToTokens for FromVariantOptions
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 FromVariantOptions
impl RefUnwindSafe for FromVariantOptions
impl !Send for FromVariantOptions
impl !Sync for FromVariantOptions
impl Unpin for FromVariantOptions
impl UnwindSafe for FromVariantOptions
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> Spanned for T
impl<T> Spanned for T
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.