#[non_exhaustive]pub enum Parse {
Struct {
attributes: Vec<Attribute>,
visibility: Visibility,
name: Ident,
generics: Option<Generics>,
generic_constraints: Option<GenericConstraints>,
body: StructBody,
},
Enum {
attributes: Vec<Attribute>,
visibility: Visibility,
name: Ident,
generics: Option<Generics>,
generic_constraints: Option<GenericConstraints>,
body: EnumBody,
},
}
Expand description
Parser for Enum and Struct derives.
You can generate this enum by calling
ⓘ
use virtue::prelude::*;
#[proc_macro_derive(YourDerive)]
pub fn derive_your_derive(input: TokenStream) -> TokenStream {
let parse = Parse::new(input).unwrap();
// rest
}
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Struct
The given input is a struct
Fields
§
visibility: Visibility
The visibility of the struct
§
generic_constraints: Option<GenericConstraints>
The generic constraits of the struct, e.g. struct Foo<F> { ... } where F: Display
will be F: Display
§
body: StructBody
The body of the struct
Enum
The given input is an enum
Fields
§
visibility: Visibility
The visibility of the enum
§
generic_constraints: Option<GenericConstraints>
The generic constraits of the enum, e.g. enum Foo<F> { ... } where F: Display
will be F: Display
Implementations§
Auto Trait Implementations§
impl Freeze for Parse
impl RefUnwindSafe for Parse
impl !Send for Parse
impl !Sync for Parse
impl Unpin for Parse
impl UnwindSafe for Parse
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