SimdJsonParser

Trait SimdJsonParser 

Source
pub trait SimdJsonParser {
    // Required methods
    async fn parse_json_simd<'de, T: Deserialize<'de>>(
        &'de mut self,
    ) -> MResult<T>;
    async fn parse_json_simd_with_max_size<'de, T: Deserialize<'de>>(
        &'de mut self,
        max_size: usize,
    ) -> MResult<T>;
}
Expand description

JSON parser from salvo::Request by sonic-rs.

Required Methods§

Source

async fn parse_json_simd<'de, T: Deserialize<'de>>(&'de mut self) -> MResult<T>

Parses json body.

To use actual SIMD parsing, compile your backend with option -C target-cpu=native.

Source

async fn parse_json_simd_with_max_size<'de, T: Deserialize<'de>>( &'de mut self, max_size: usize, ) -> MResult<T>

Parses json body with size limit.

To use actual SIMD parsing, compile your backend with option -C target-cpu=native.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl SimdJsonParser for Request

Available on crate feature salvo and neither WebAssembly nor WebAssembly only.
Source§

async fn parse_json_simd<'de, T: Deserialize<'de>>(&'de mut self) -> MResult<T>

Source§

async fn parse_json_simd_with_max_size<'de, T: Deserialize<'de>>( &'de mut self, max_size: usize, ) -> MResult<T>

Implementors§