Skip to main content

Variants

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: Ident

The fallback variant.

§other_type: Type

The type of the field of the fallback variant.

Implementations§

§

impl Variants

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>

Parses a string literal.

pub(crate) fn parse_int(input: ParseStream<'_>) -> Result<TokenStream>

Parses an integer literal with an optional minus sign.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.