Trait TryParse

Source
pub trait TryParse
where Self: Sized,
{ type Err; // Required method fn try_parse( iter: &mut impl Iterator<Item = u8>, ) -> Result<Self, TryParseError<Self::Err>>; }
Expand description

Allows a type to be parsed through the try_parse, parse, try_scan and scan macros.

Required Associated Types§

Source

type Err

Error type used in the TryParseError.

Required Methods§

Source

fn try_parse( iter: &mut impl Iterator<Item = u8>, ) -> Result<Self, TryParseError<Self::Err>>

Attempts to parse the type using an u8 iterator.

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 TryParse for f32
where Self: FromStr,

Source§

type Err = <f32 as FromStr>::Err

Source§

fn try_parse( iter: &mut impl Iterator<Item = u8>, ) -> Result<Self, TryParseError<Self::Err>>

Source§

impl TryParse for f64
where Self: FromStr,

Source§

type Err = <f64 as FromStr>::Err

Source§

fn try_parse( iter: &mut impl Iterator<Item = u8>, ) -> Result<Self, TryParseError<Self::Err>>

Source§

impl TryParse for i8
where Self: FromStr,

Source§

type Err = <i8 as FromStr>::Err

Source§

fn try_parse( iter: &mut impl Iterator<Item = u8>, ) -> Result<Self, TryParseError<Self::Err>>

Source§

impl TryParse for i16
where Self: FromStr,

Source§

type Err = <i16 as FromStr>::Err

Source§

fn try_parse( iter: &mut impl Iterator<Item = u8>, ) -> Result<Self, TryParseError<Self::Err>>

Source§

impl TryParse for i32
where Self: FromStr,

Source§

type Err = <i32 as FromStr>::Err

Source§

fn try_parse( iter: &mut impl Iterator<Item = u8>, ) -> Result<Self, TryParseError<Self::Err>>

Source§

impl TryParse for i64
where Self: FromStr,

Source§

type Err = <i64 as FromStr>::Err

Source§

fn try_parse( iter: &mut impl Iterator<Item = u8>, ) -> Result<Self, TryParseError<Self::Err>>

Source§

impl TryParse for i128
where Self: FromStr,

Source§

type Err = <i128 as FromStr>::Err

Source§

fn try_parse( iter: &mut impl Iterator<Item = u8>, ) -> Result<Self, TryParseError<Self::Err>>

Source§

impl TryParse for u8
where Self: FromStr,

Source§

type Err = <u8 as FromStr>::Err

Source§

fn try_parse( iter: &mut impl Iterator<Item = u8>, ) -> Result<Self, TryParseError<Self::Err>>

Source§

impl TryParse for u16
where Self: FromStr,

Source§

type Err = <u16 as FromStr>::Err

Source§

fn try_parse( iter: &mut impl Iterator<Item = u8>, ) -> Result<Self, TryParseError<Self::Err>>

Source§

impl TryParse for u32
where Self: FromStr,

Source§

type Err = <u32 as FromStr>::Err

Source§

fn try_parse( iter: &mut impl Iterator<Item = u8>, ) -> Result<Self, TryParseError<Self::Err>>

Source§

impl TryParse for u64
where Self: FromStr,

Source§

type Err = <u64 as FromStr>::Err

Source§

fn try_parse( iter: &mut impl Iterator<Item = u8>, ) -> Result<Self, TryParseError<Self::Err>>

Source§

impl TryParse for u128
where Self: FromStr,

Source§

type Err = <u128 as FromStr>::Err

Source§

fn try_parse( iter: &mut impl Iterator<Item = u8>, ) -> Result<Self, TryParseError<Self::Err>>

Source§

impl TryParse for String
where Self: FromStr,

Source§

type Err = <String as FromStr>::Err

Source§

fn try_parse( iter: &mut impl Iterator<Item = u8>, ) -> Result<Self, TryParseError<Self::Err>>

Implementors§