Lit

Trait Lit 

Source
pub trait Lit: Sized + Sealed {
    // Required method
    fn parse(input: ParseStream<'_>) -> Result<Self>;
}
Expand description

A value that can be parsed by this crate from a syn::Lit.

See set::lit and on::lit for usage examples.

This trait is sealed, and cannot be implemented for types outside this crate.

Required Methods§

Source

fn parse(input: ParseStream<'_>) -> Result<Self>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Lit for bool

Source§

fn parse(input: ParseStream<'_>) -> Result<Self>

Source§

impl Lit for char

Source§

fn parse(input: ParseStream<'_>) -> Result<Self>

Source§

impl Lit for f32

Source§

fn parse(input: ParseStream<'_>) -> Result<Self>

Source§

impl Lit for f64

Source§

fn parse(input: ParseStream<'_>) -> Result<Self>

Source§

impl Lit for i8

Source§

fn parse(input: ParseStream<'_>) -> Result<Self>

Source§

impl Lit for i16

Source§

fn parse(input: ParseStream<'_>) -> Result<Self>

Source§

impl Lit for i32

Source§

fn parse(input: ParseStream<'_>) -> Result<Self>

Source§

impl Lit for i64

Source§

fn parse(input: ParseStream<'_>) -> Result<Self>

Source§

impl Lit for i128

Source§

fn parse(input: ParseStream<'_>) -> Result<Self>

Source§

impl Lit for isize

Source§

fn parse(input: ParseStream<'_>) -> Result<Self>

Source§

impl Lit for u8

Source§

fn parse(input: ParseStream<'_>) -> Result<Self>

Note that bytes may parsed from a LitInt or a LitByte.

Source§

impl Lit for u16

Source§

fn parse(input: ParseStream<'_>) -> Result<Self>

Source§

impl Lit for u32

Source§

fn parse(input: ParseStream<'_>) -> Result<Self>

Source§

impl Lit for u64

Source§

fn parse(input: ParseStream<'_>) -> Result<Self>

Source§

impl Lit for u128

Source§

fn parse(input: ParseStream<'_>) -> Result<Self>

Source§

impl Lit for usize

Source§

fn parse(input: ParseStream<'_>) -> Result<Self>

Source§

impl Lit for CString

Source§

fn parse(input: ParseStream<'_>) -> Result<Self>

Source§

impl Lit for String

Source§

fn parse(input: ParseStream<'_>) -> Result<Self>

Source§

impl Lit for Vec<u8>

Source§

fn parse(input: ParseStream<'_>) -> Result<Self>

Implementors§