Macro peel_ip::prelude::verify
[−]
macro_rules! verify { ( __impl $ i : expr , $ submac : ident ! ( $ ( $ args : tt ) * ) , $ submac2 : ident ! ( $ ( $ args2 : tt ) * ) ) => { ... }; ( $ i : expr , $ submac : ident ! ( $ ( $ args : tt ) * ) , $ g : expr ) => { ... }; ( $ i : expr , $ submac : ident ! ( $ ( $ args : tt ) * ) , $ submac2 : ident ! ( $ ( $ args2 : tt ) * ) ) => { ... }; ( $ i : expr , $ f : expr , $ g : expr ) => { ... }; ( $ i : expr , $ f : expr , $ submac : ident ! ( $ ( $ args : tt ) * ) ) => { ... }; }
verify!(I -> IResult<I,O>, O -> bool) => I -> IResult<I, O>
returns the result of the child parser if it satisfies a verifcation function
named!(check<u32>, verify!(be_u32, |val:u32| val >= 0 && val < 3));