Enum rsonpath::result::NodeTypeHint
source · #[non_exhaustive]pub enum NodeTypeHint {
Atomic,
Complex(BracketType),
AnyComplex,
Any,
}
Expand description
Hint given by the engine to a QueryResultBuilder
as to what type of node was matched.
Since the byte offset given by the engine is not stable and can fall anywhere between the actual value’s start and the preceding structural character, this helps a builder quickly advance to the actual value and parse it.
This is non_exhaustive, since we may add more hints for performance reasons, and the implementations
are already forced to handle the Any
variant. The behavior for “unknown”
hints should be the same as for Any
.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Atomic
The value is any atom (number, string, boolean, null).
Complex(BracketType)
The value is an object or an array, and we know what type of bracket to look for.
AnyComplex
The value is an object or an array, but we do not know which. The builder should seek for a ‘{’ or ‘[’.
Any
The value can be any JSON value, we know nothing more.
Trait Implementations§
source§impl Clone for NodeTypeHint
impl Clone for NodeTypeHint
source§fn clone(&self) -> NodeTypeHint
fn clone(&self) -> NodeTypeHint
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for NodeTypeHint
impl Debug for NodeTypeHint
source§impl Hash for NodeTypeHint
impl Hash for NodeTypeHint
source§impl PartialEq<NodeTypeHint> for NodeTypeHint
impl PartialEq<NodeTypeHint> for NodeTypeHint
source§fn eq(&self, other: &NodeTypeHint) -> bool
fn eq(&self, other: &NodeTypeHint) -> bool
self
and other
values to be equal, and is used
by ==
.