Struct Variants
pub(crate) struct Variants {
pub(crate) idents: Vec<Ident>,
pub(crate) values: Vec<TokenStream>,
pub(crate) other: Ident,
pub(crate) other_type: Type,
}Expand description
The parsed variants of an enum with a fallback variant.
Fields§
§idents: Vec<Ident>The unit variants.
values: Vec<TokenStream>The D-Bus values of the unit variants, in the same order.
other: IdentThe fallback variant.
other_type: TypeThe type of the field of the fallback variant.
Implementations§
§impl Variants
impl Variants
pub(crate) fn parse(
input: &DeriveInput,
parse_value: fn(ParseStream<'_>) -> Result<TokenStream>,
) -> Result<Self>
pub(crate) fn parse( input: &DeriveInput, parse_value: fn(ParseStream<'_>) -> Result<TokenStream>, ) -> Result<Self>
Parses the variants of input.
parse_value parses the value of a #[remora(value = ...)] attribute
into a literal that works as a match pattern.
pub(crate) fn parse_string(input: ParseStream<'_>) -> Result<TokenStream>
pub(crate) fn parse_string(input: ParseStream<'_>) -> Result<TokenStream>
Parses a string literal.
pub(crate) fn parse_int(input: ParseStream<'_>) -> Result<TokenStream>
pub(crate) fn parse_int(input: ParseStream<'_>) -> Result<TokenStream>
Parses an integer literal with an optional minus sign.
Auto Trait Implementations§
impl !Send for Variants
impl !Sync for Variants
impl Freeze for Variants
impl RefUnwindSafe for Variants
impl Unpin for Variants
impl UnsafeUnpin for Variants
impl UnwindSafe for Variants
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