Trait ToFormatParser

Source
pub trait ToFormatParser<'a> {
    type Parser: Iterator<Item = ParseSegment<'a>>;

    // Required methods
    fn to_parser(&'a self) -> Self::Parser;
    fn unparsed(iter: Self::Parser) -> &'a str;
}
Expand description

Turn a value into parsed formatting segments on the fly.

Required Associated Types§

Source

type Parser: Iterator<Item = ParseSegment<'a>>

The Parser type that returns the ParseSegments

Required Methods§

Source

fn to_parser(&'a self) -> Self::Parser

Turn this value into the parser

Source

fn unparsed(iter: Self::Parser) -> &'a str

Get the unparsed str from this parser. Used to determine if there was an error while parsing.

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<'a> ToFormatParser<'a> for str

Source§

type Parser = FromStr<'a>

Source§

fn to_parser(&'a self) -> Self::Parser

Source§

fn unparsed(iter: Self::Parser) -> &'a str

Implementors§