pub struct One<T> { /* private fields */ }Expand description
Match an item
§example
let code = "asd".span();
let a = one('a');
let r = a.parse(code);
assert_eq!(r, Some(0..1))Implementations§
Trait Implementations§
Source§impl<I: TimeTravel, T> Parser<I> for One<T>
impl<I: TimeTravel, T> Parser<I> for One<T>
type Output = Range<usize>
Source§fn map<U, F>(self, f: F) -> Map<Self, I, F>
fn map<U, F>(self, f: F) -> Map<Self, I, F>
Map a
Parser<Output = T> to Parser<Output = U> by applying a function to a contained valueSource§fn many_min_max(self, min: usize, max: usize) -> Many<Self, I>where
Self: Sized,
fn many_min_max(self, min: usize, max: usize) -> Many<Self, I>where
Self: Sized,
{n,m}, >= n && <= mSource§fn and_then<U, F>(self, f: F) -> AndThen<Self, I, F>
fn and_then<U, F>(self, f: F) -> AndThen<Self, I, F>
Fail if the subparser fail, otherwise calls f with the new Parser and parse the Parser
Source§fn or_else<U, F>(self, f: F) -> OrElse<Self, I, F>
fn or_else<U, F>(self, f: F) -> OrElse<Self, I, F>
Pass if subparser pass, otherwise calls f and parse the result Parser
Source§fn or_trans<F>(self, no_retry: bool, f: F) -> OrTrans<Self, I, F>
fn or_trans<F>(self, no_retry: bool, f: F) -> OrTrans<Self, I, F>
Pass if subparser pass, otherwise calls f with error point Read more
impl<T: Eq> Eq for One<T>
impl<T> StructuralPartialEq for One<T>
Auto Trait Implementations§
impl<T> Freeze for One<T>where
T: Freeze,
impl<T> RefUnwindSafe for One<T>where
T: RefUnwindSafe,
impl<T> Send for One<T>where
T: Send,
impl<T> Sync for One<T>where
T: Sync,
impl<T> Unpin for One<T>where
T: Unpin,
impl<T> UnwindSafe for One<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more