Return

Enum Return 

Source
pub enum Return {
    Infer,
    Int(i128),
    UInt(u128),
    Float(f64),
    String(String),
    Object(Object),
    Expression(Expression),
    Identifier(String),
    Array(Box<[Return]>),
    Unit,
}
Expand description

The Return enum is used as the return type of both methods and functions. It defines both the type and the value.

Variants§

§

Infer

The ‘Infer’ variant is the same as the _ token in Rust

§

Int(i128)

A signed integer

§

UInt(u128)

An unsigned integer

§

Float(f64)

A floating point value

§

String(String)

A String

§

Object(Object)

An Object (created via the SealedObjectType::new_instance method)

§

Expression(Expression)

An Expression (created via the Expression::try_from::<TokenStream> method)

§

Identifier(String)

Can be used to indirectly reference another value within the proc macro environment

§

Array(Box<[Return]>)

An array of Array enum values

§

Unit

The ‘Unit’ variant is the same as the () token in Rust

Trait Implementations§

Source§

impl<T> From<&[T]> for Return
where T: RecurseSafeFrom,

Source§

fn from(value: &[T]) -> Self

Converts to this type from the input type.
Source§

impl From<()> for Return

Source§

fn from(_: ()) -> Self

Converts to this type from the input type.
Source§

impl<T> From<Box<[T]>> for Return
where T: RecurseSafeFrom,

Source§

fn from(value: Box<[T]>) -> Self

Converts to this type from the input type.
Source§

impl From<Expression> for Return

Source§

fn from(value: Expression) -> Self

Converts to this type from the input type.
Source§

impl From<Object> for Return

Source§

fn from(value: Object) -> Self

Converts to this type from the input type.
Source§

impl From<String> for Return

Source§

fn from(value: String) -> Self

Converts to this type from the input type.
Source§

impl From<f32> for Return

Source§

fn from(value: f32) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for Return

Source§

fn from(value: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i128> for Return

Source§

fn from(value: i128) -> Self

Converts to this type from the input type.
Source§

impl From<i16> for Return

Source§

fn from(value: i16) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for Return

Source§

fn from(value: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for Return

Source§

fn from(value: i64) -> Self

Converts to this type from the input type.
Source§

impl From<i8> for Return

Source§

fn from(value: i8) -> Self

Converts to this type from the input type.
Source§

impl From<isize> for Return

Source§

fn from(value: isize) -> Self

Converts to this type from the input type.
Source§

impl From<u128> for Return

Source§

fn from(value: u128) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for Return

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for Return

Source§

fn from(value: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u64> for Return

Source§

fn from(value: u64) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for Return

Source§

fn from(value: u8) -> Self

Converts to this type from the input type.
Source§

impl From<usize> for Return

Source§

fn from(value: usize) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Return

§

impl !RefUnwindSafe for Return

§

impl !Send for Return

§

impl !Sync for Return

§

impl Unpin for Return

§

impl !UnwindSafe for Return

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 = Infallible

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.