pub struct Input {
pub text: Str,
/* private fields */
}
Fields§
§text: Str
Implementations§
Source§impl Input
impl Input
pub fn new(text: impl ToString) -> Self
pub fn start(&mut self) -> ModifyInput<'_>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn rest(&self) -> &str
pub fn prev_slice_bytes(&self, bytes: usize) -> StrSlice
pub fn bump(&mut self, bytes: usize) -> StrSlice
pub fn peek_char(&self) -> Option<char>
pub fn prev_char(&self) -> Option<char>
Sourcepub fn parse<P: Parse>(&mut self, parser: P) -> Option<P::Output>
pub fn parse<P: Parse>(&mut self, parser: P) -> Option<P::Output>
This parses the specified parser and returns the result. If it fails,
None
is returned. For correctness, the parser should NOT be bumped
if None
is returned.
Sourcepub fn parse_i<P: ParseInfallible>(&mut self, parser: P) -> P::Output
pub fn parse_i<P: ParseInfallible>(&mut self, parser: P) -> P::Output
This parses the specified parser and returns the result. The parser can’t fail.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Input
impl RefUnwindSafe for Input
impl Send for Input
impl Sync for Input
impl Unpin for Input
impl UnwindSafe for Input
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