pub struct JsonModel { /* private fields */ }Expand description
JSON structure-aware context model.
Implementations§
Source§impl JsonModel
impl JsonModel
Sourcepub fn with_size(cmap_size: usize) -> Self
pub fn with_size(cmap_size: usize) -> Self
Create a JSON model with a custom ContextMap size (in bytes).
Sourcepub fn predict(&mut self, c0: u32, bpos: u8, c1: u8) -> u32
pub fn predict(&mut self, c0: u32, bpos: u8, c1: u8) -> u32
Predict based on JSON structure context.
c0: partial byte (1-255).
bpos: bit position (0-7).
c1: last completed byte.
Sourcepub fn json_state_byte(&self) -> u8
pub fn json_state_byte(&self) -> u8
Return the current JSON state as a byte for mixer context. Returns 0-15 encoding the JSON parser state.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JsonModel
impl RefUnwindSafe for JsonModel
impl Send for JsonModel
impl Sync for JsonModel
impl Unpin for JsonModel
impl UnsafeUnpin for JsonModel
impl UnwindSafe for JsonModel
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