Skip to main content

Module serde

Module serde 

Source
Expand description

serde::Deserializer implementation backed by the simdjson tape.

This allows you to deserialize any serde::Deserialize type directly from simdjson’s DOM tape without first converting to an intermediate AST.

§Example

use serde::Deserialize;
use simdjson_rust::serde::from_str;

#[derive(Debug, Deserialize, PartialEq)]
struct Point {
    x: f64,
    y: f64,
}

let p: Point = from_str(r#"{"x": 1.0, "y": 2.0}"#).unwrap();
assert_eq!(p, Point { x: 1.0, y: 2.0 });

Structs§

TapeDeserializer
A serde::Deserializer that reads directly from the simdjson tape.

Enums§

Error
The error type returned by the Serde deserializer.

Functions§

from_bytes
Deserialize T from a JSON byte slice using the simdjson DOM tape.
from_str
Deserialize T from a JSON string using the simdjson DOM tape.
from_tape
Deserialize T directly from a parsed TapeRef cursor.

Type Aliases§

Result