pub trait Json:
Sized
+ Send
+ Sync
+ 'static {
type Node<'a>: Node<'a, Self>;
type PreparedKey: Send + Sync;
type StringBuffer: Default;
// Required methods
fn prepare_key(key: &str) -> Self::PreparedKey;
fn with_string_node<T>(
buffer: &mut Self::StringBuffer,
string: &str,
f: impl FnOnce(Self::Node<'_>) -> T,
) -> T;
}Expand description
One JSON representation.
Required Associated Types§
type Node<'a>: Node<'a, Self>
Sourcetype PreparedKey: Send + Sync
type PreparedKey: Send + Sync
Property name prepared once at compile time, for repeated object lookups.
Sourcetype StringBuffer: Default
type StringBuffer: Default
Scratch storage for Json::with_string_node, reusable across calls.
Required Methods§
fn prepare_key(key: &str) -> Self::PreparedKey
Sourcefn with_string_node<T>(
buffer: &mut Self::StringBuffer,
string: &str,
f: impl FnOnce(Self::Node<'_>) -> T,
) -> T
fn with_string_node<T>( buffer: &mut Self::StringBuffer, string: &str, f: impl FnOnce(Self::Node<'_>) -> T, ) -> T
Call f with a node holding string, backed by buffer.
propertyNames validates each property name through this, so names run through the
same subschema machinery as any other node of the representation.
Representations whose nodes point into an encoded document have two options: a plain
string variant on the node type, or encoding a single-string document into buffer.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".