#[repr(C)]pub struct ReadStatBufferCtx {
data: *const u8,
len: usize,
pos: usize,
}Expand description
In-memory buffer context for ReadStat I/O callbacks.
Wraps a borrowed byte slice and tracks the current read position.
Passed as the io_ctx pointer to all I/O handler callbacks.
Fields§
§data: *const u8§len: usize§pos: usizeImplementations§
Source§impl ReadStatBufferCtx
impl ReadStatBufferCtx
Sourcepub const fn new(bytes: &[u8]) -> Self
pub const fn new(bytes: &[u8]) -> Self
Creates a new buffer context from a byte slice.
The caller must ensure the byte slice outlives the context and any parsing operations that use it.
Sourcepub fn configure_parser(
&mut self,
parser: ReadStatParser,
) -> Result<ReadStatParser, ReadStatError>
pub fn configure_parser( &mut self, parser: ReadStatParser, ) -> Result<ReadStatParser, ReadStatError>
Configures a ReadStatParser to read from this buffer context
instead of from a file.
Auto Trait Implementations§
impl Freeze for ReadStatBufferCtx
impl RefUnwindSafe for ReadStatBufferCtx
impl !Send for ReadStatBufferCtx
impl !Sync for ReadStatBufferCtx
impl Unpin for ReadStatBufferCtx
impl UnwindSafe for ReadStatBufferCtx
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more