pub trait Input<'a>: Clone {
Show 14 methods
    // Required methods
    fn cur(&self) -> Option<char>;
    fn peek(&self) -> Option<char>;
    fn peek_ahead(&self) -> Option<char>;
    unsafe fn bump(&mut self);
    fn is_at_start(&self) -> bool;
    fn cur_pos(&self) -> BytePos;
    fn last_pos(&self) -> BytePos;
    unsafe fn slice(&mut self, start: BytePos, end: BytePos) -> &'a str;
    fn uncons_while<F>(&mut self, f: F) -> &'a str
       where F: FnMut(char) -> bool;
    unsafe fn reset_to(&mut self, to: BytePos);
    fn is_str(&self, s: &str) -> bool;
    // Provided methods
    fn cur_as_ascii(&self) -> Option<u8> { ... }
    fn is_byte(&self, c: u8) -> bool { ... }
    fn eat_byte(&mut self, c: u8) -> bool { ... }
}Required Methods§
fn cur(&self) -> Option<char>
fn peek(&self) -> Option<char>
fn peek_ahead(&self) -> Option<char>
Sourceunsafe fn bump(&mut self)
 
unsafe fn bump(&mut self)
§Safety
This should be called only when cur() returns Some. i.e.
when the Input is not empty.
fn is_at_start(&self) -> bool
fn cur_pos(&self) -> BytePos
fn last_pos(&self) -> BytePos
Sourceunsafe fn slice(&mut self, start: BytePos, end: BytePos) -> &'a str
 
unsafe fn slice(&mut self, start: BytePos, end: BytePos) -> &'a str
§Safety
- start should be less than or equal to end.
- start and end should be in the valid range of input.
Sourcefn uncons_while<F>(&mut self, f: F) -> &'a str
 
fn uncons_while<F>(&mut self, f: F) -> &'a str
Takes items from stream, testing each one with predicate. returns the range of items which passed predicate.
Provided Methods§
Sourcefn cur_as_ascii(&self) -> Option<u8>
 
fn cur_as_ascii(&self) -> Option<u8>
Returns None if it’s end of input or current character is not an ascii character.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.