pub struct SimdJsonParser { /* private fields */ }Expand description
High-performance JSON parser using SIMD instructions
Implementations§
Source§impl SimdJsonParser
impl SimdJsonParser
Sourcepub fn parse<T: DeserializeOwned>(
&self,
data: &mut [u8],
) -> Result<T, SimdJsonError>
pub fn parse<T: DeserializeOwned>( &self, data: &mut [u8], ) -> Result<T, SimdJsonError>
Sourcepub fn parse_str<T: DeserializeOwned>(
&self,
data: &str,
) -> Result<T, SimdJsonError>
pub fn parse_str<T: DeserializeOwned>( &self, data: &str, ) -> Result<T, SimdJsonError>
Parse JSON string into a typed value
Note: This creates a copy of the string for mutation. For zero-copy,
use parse with a mutable byte slice.
Sourcepub fn parse_batch<T: DeserializeOwned>(
&self,
documents: &mut [Vec<u8>],
) -> Vec<Result<T, SimdJsonError>>
pub fn parse_batch<T: DeserializeOwned>( &self, documents: &mut [Vec<u8>], ) -> Vec<Result<T, SimdJsonError>>
Parse multiple JSON documents in a batch
Optimized for processing many small documents efficiently.
Sourcepub fn parse_with_arena<'a, T: DeserializeOwned>(
&self,
data: &mut [u8],
_arena: &'a Bump,
) -> Result<T, SimdJsonError>
pub fn parse_with_arena<'a, T: DeserializeOwned>( &self, data: &mut [u8], _arena: &'a Bump, ) -> Result<T, SimdJsonError>
Parse JSON with arena allocation for zero-copy string handling
The arena provides fast bump allocation and all allocations are freed together when the arena is dropped.
Sourcepub fn stats(&self) -> &SimdJsonStats
pub fn stats(&self) -> &SimdJsonStats
Get parsing statistics
Sourcepub fn reset_stats(&self)
pub fn reset_stats(&self)
Reset statistics
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SimdJsonParser
impl RefUnwindSafe for SimdJsonParser
impl Send for SimdJsonParser
impl Sync for SimdJsonParser
impl Unpin for SimdJsonParser
impl UnwindSafe for SimdJsonParser
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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