[][src]Trait reformation::ReformationPrimitive

pub trait ReformationPrimitive { }

Marker trait allowing user to override inner regex of type via attribute

use reformation::Reformation;

#[derive(Reformation)]
#[reformation("{}")]
struct A<'input>(
    #[reformation("[a-z_]+")] // now A will match every lowercase set of words, separated with underscores
    &'input str
);

#[derive(Reformation)]
#[reformation("{}")]
struct B<'input>(
    // #[reformation("whatever")] // not allowed, because A does not implement ```ReformationPrimitive```
    A<'input>
);

fn main(){
    let a = A::parse("one_more__").unwrap();
    assert_eq!(a.0, "one_more__");
}

Implementations on Foreign Types

impl ReformationPrimitive for u8[src]

impl ReformationPrimitive for u16[src]

impl ReformationPrimitive for u32[src]

impl ReformationPrimitive for u64[src]

impl ReformationPrimitive for u128[src]

impl ReformationPrimitive for usize[src]

impl ReformationPrimitive for i8[src]

impl ReformationPrimitive for i16[src]

impl ReformationPrimitive for i32[src]

impl ReformationPrimitive for i64[src]

impl ReformationPrimitive for i128[src]

impl ReformationPrimitive for isize[src]

impl ReformationPrimitive for f32[src]

impl ReformationPrimitive for f64[src]

impl ReformationPrimitive for String[src]

impl ReformationPrimitive for char[src]

impl<T> ReformationPrimitive for Option<T>[src]

impl<'a> ReformationPrimitive for &'a str[src]

Loading content...

Implementors

Loading content...