[−][src]Trait reformation::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__"); }