Struct makepad_live_tokenizer::tokenizer::Cursor
source · pub struct Cursor<'a> { /* private fields */ }
Expand description
A cursor over a slice of chars.
Implementations§
source§impl<'a> Cursor<'a>
impl<'a> Cursor<'a>
sourcepub fn new(chars: &'a [char], scratch: &'a mut String) -> Cursor<'a>
pub fn new(chars: &'a [char], scratch: &'a mut String) -> Cursor<'a>
Creates a cursor over a slice of chars. The scratch
parameter provides scratch storage for
building a string when necessary.
Examples
use makepad_live_tokenizer::tokenizer::Cursor;
let mut scratch = String::new();
let cursor = Cursor::new(&['1', '2', '3'], &mut scratch);
pub fn index(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Cursor<'a>
impl<'a> Send for Cursor<'a>
impl<'a> Sync for Cursor<'a>
impl<'a> Unpin for Cursor<'a>
impl<'a> !UnwindSafe for Cursor<'a>
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