pub struct ScanBuffer { /* private fields */ }Expand description
A refillable buffer for streaming JSON parsing.
Uses a grow-only strategy: we either reset (when all data processed) or grow (when mid-token). Never compacts/shifts data.
Implementations§
Source§impl ScanBuffer
impl ScanBuffer
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a new buffer with a specific capacity.
Sourcepub fn from_slice(slice: &[u8]) -> Self
pub fn from_slice(slice: &[u8]) -> Self
Create a buffer from an existing slice (for slice-based parsing).
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Reset the buffer for fresh data.
Called when all data has been processed (scanner returned Eof but reader has more). This is NOT compaction - we’re simply starting fresh because everything was consumed.
Trait Implementations§
Source§impl Debug for ScanBuffer
impl Debug for ScanBuffer
Auto Trait Implementations§
impl Freeze for ScanBuffer
impl RefUnwindSafe for ScanBuffer
impl Send for ScanBuffer
impl Sync for ScanBuffer
impl Unpin for ScanBuffer
impl UnwindSafe for ScanBuffer
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