[][src]Trait reformation::Reformation

pub trait Reformation<'t>: Sized {
    fn regex_str() -> &'static str;
fn captures_count() -> usize;
fn from_captures<'a>(
        c: &Captures<'a, 't>,
        offset: usize
    ) -> Result<Self, Error>;
fn parse(input: &'t str) -> Result<Self, Error>; }

Required methods

fn regex_str() -> &'static str

regular expression for matching this struct

fn captures_count() -> usize

number of used capture groups.

fn from_captures<'a>(c: &Captures<'a, 't>, offset: usize) -> Result<Self, Error>

create instance of function from captures with given offset

fn parse(input: &'t str) -> Result<Self, Error>

parse struct from str

default implementation is not zero-cost abstraction, which must be kept in mind when implementing trait by hand. (This version uses generic_static to handle lazy initialization, which imply some extra costs, but for non-generic types it can be implemented with lazy_static!)

Loading content...

Implementations on Foreign Types

impl<'t> Reformation<'t> for u8[src]

impl<'t> Reformation<'t> for u16[src]

impl<'t> Reformation<'t> for u32[src]

impl<'t> Reformation<'t> for u64[src]

impl<'t> Reformation<'t> for u128[src]

impl<'t> Reformation<'t> for usize[src]

impl<'t> Reformation<'t> for i8[src]

impl<'t> Reformation<'t> for i16[src]

impl<'t> Reformation<'t> for i32[src]

impl<'t> Reformation<'t> for i64[src]

impl<'t> Reformation<'t> for i128[src]

impl<'t> Reformation<'t> for isize[src]

impl<'t> Reformation<'t> for f32[src]

impl<'t> Reformation<'t> for f64[src]

impl<'t> Reformation<'t> for String[src]

impl<'t> Reformation<'t> for char[src]

impl<'t, T: Reformation<'t>> Reformation<'t> for Option<T>[src]

impl<'t> Reformation<'t> for &'t str[src]

Loading content...

Implementors

Loading content...