pub struct LexBuffer { /* private fields */ }Expand description
Growable token-text buffer for the lexer.
TODO: ZIO/LexBuffer will move to lua_vm::zio (separate refactor).
Implementations§
Source§impl LexBuffer
impl LexBuffer
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn capacity(&self) -> usize
pub fn as_slice(&self) -> &[u8] ⓘ
pub fn clear(&mut self)
pub fn truncate_by(&mut self, i: usize)
Sourcepub fn resize(
&mut self,
_state: &mut LuaState,
size: usize,
) -> Result<(), LuaError>
pub fn resize( &mut self, _state: &mut LuaState, size: usize, ) -> Result<(), LuaError>
Ensure the buffer can hold size bytes by adjusting allocated capacity,
never the live byte count (otherwise push_byte would write past the live
content and leave embedded zero padding inside the token text).
Trait Implementations§
Auto Trait Implementations§
impl Forget for LexBuffer
impl Freeze for LexBuffer
impl Move for LexBuffer
impl RefUnwindSafe for LexBuffer
impl Send for LexBuffer
impl Sync for LexBuffer
impl Unpin for LexBuffer
impl UnsafeUnpin for LexBuffer
impl UnwindSafe for LexBuffer
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