pub struct SchemaNode(/* private fields */);Expand description
Shared immutable representation of a resolved JSON Schema node.
Reference counting allows multiple parents to point to the same node, which
is required to faithfully model schemas containing recursive $refs.
Implementations§
Source§impl SchemaNode
impl SchemaNode
Sourcepub fn kind(&self) -> &SchemaNodeKind
pub fn kind(&self) -> &SchemaNodeKind
Return the resolved semantic variant for this node.
The returned value is part of the canonical IR. It intentionally omits
parser-only states such as $ref.
Sourcepub fn id(&self) -> NodeId
pub fn id(&self) -> NodeId
Return a stable identity for this in-memory node.
Identities are only meaningful within one resolved schema graph and are primarily used for cycle guards.
Sourcepub fn accepts_value(&self, value: &Value) -> bool
pub fn accepts_value(&self, value: &Value) -> bool
Check whether one instance is accepted by this canonicalized AST node.
This is a low-level evaluator for resolved subgraphs used by
compatibility and generation crates. User-visible validation should go
through SchemaDocument::is_valid, which uses the jsonschema
backend compiled from the original raw schema document.
Trait Implementations§
Source§impl Borrow<SchemaNodeKind> for SchemaNode
impl Borrow<SchemaNodeKind> for SchemaNode
Source§fn borrow(&self) -> &SchemaNodeKind
fn borrow(&self) -> &SchemaNodeKind
Source§impl Clone for SchemaNode
impl Clone for SchemaNode
Source§fn clone(&self) -> SchemaNode
fn clone(&self) -> SchemaNode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SchemaNode
impl Debug for SchemaNode
Source§impl PartialEq for SchemaNode
impl PartialEq for SchemaNode
impl Eq for SchemaNode
Auto Trait Implementations§
impl Freeze for SchemaNode
impl !RefUnwindSafe for SchemaNode
impl !Send for SchemaNode
impl !Sync for SchemaNode
impl Unpin for SchemaNode
impl UnsafeUnpin for SchemaNode
impl !UnwindSafe for SchemaNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.