Converter

Trait Converter 

Source
pub trait Converter<T>: Parse {
    // Required method
    fn into(self) -> Result<T>;

    // Provided method
    fn convert(stream: &ParseStream<'_>) -> Result<T> { ... }
}

Required Methods§

Source

fn into(self) -> Result<T>

Provided Methods§

Source

fn convert(stream: &ParseStream<'_>) -> Result<T>

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 Converter<bool> for LitBool

Source§

fn into(self) -> Result<bool>

Source§

impl Converter<f32> for LitFloat

Source§

fn into(self) -> Result<f32>

Source§

impl Converter<f64> for LitFloat

Source§

fn into(self) -> Result<f64>

Source§

impl Converter<i8> for LitInt

Source§

fn into(self) -> Result<i8>

Source§

impl Converter<i16> for LitInt

Source§

fn into(self) -> Result<i16>

Source§

impl Converter<i32> for LitInt

Source§

fn into(self) -> Result<i32>

Source§

impl Converter<i64> for LitInt

Source§

fn into(self) -> Result<i64>

Source§

impl Converter<usize> for LitInt

Source§

impl Converter<String> for LitStr

Implementors§

Source§

impl<T, C: Converter<T>> Converter<Option<T>> for C