utils::parser

Trait Parseable

Source
pub trait Parseable {
    type Parser: for<'i> Parser<Output<'i> = Self>;

    const PARSER: Self::Parser;
}
Expand description

Trait for types that have a canonical parser.

Required Associated Constants§

Source

const PARSER: Self::Parser

Required Associated Types§

Source

type Parser: for<'i> Parser<Output<'i> = 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 Parseable for i8

Source§

const PARSER: Self::Parser

Source§

type Parser = SignedParser<i8>

Source§

impl Parseable for i16

Source§

const PARSER: Self::Parser

Source§

type Parser = SignedParser<i16>

Source§

impl Parseable for i32

Source§

const PARSER: Self::Parser

Source§

type Parser = SignedParser<i32>

Source§

impl Parseable for i64

Source§

const PARSER: Self::Parser

Source§

type Parser = SignedParser<i64>

Source§

impl Parseable for i128

Source§

const PARSER: Self::Parser

Source§

type Parser = SignedParser<i128>

Source§

impl Parseable for u8

Source§

const PARSER: Self::Parser

Source§

type Parser = UnsignedParser<u8>

Source§

impl Parseable for u16

Source§

const PARSER: Self::Parser

Source§

type Parser = UnsignedParser<u16>

Source§

impl Parseable for u32

Source§

const PARSER: Self::Parser

Source§

type Parser = UnsignedParser<u32>

Source§

impl Parseable for u64

Source§

const PARSER: Self::Parser

Source§

type Parser = UnsignedParser<u64>

Source§

impl Parseable for u128

Source§

const PARSER: Self::Parser

Source§

type Parser = UnsignedParser<u128>

Source§

impl Parseable for usize

Parsing as usize should be discouraged as it leads to parsers which behave differently at runtime on 32-bit and 64-bit platforms, so no parser::usize() function is provided.

However, Parseable is implemented for usize as it is safe to use number_range() with a constant hard-coded max, which will fail at compile time if the constant is too large for the platform’s usize.

Source§

const PARSER: Self::Parser

Source§

type Parser = UnsignedParser<usize>

Implementors§