pub enum SchemaNode {
ValidNode(ValidNode),
InvalidNode(InvalidNode),
}
Variants§
ValidNode(ValidNode)
InvalidNode(InvalidNode)
Implementations§
Source§impl SchemaNode
impl SchemaNode
pub fn any() -> AnyNode
pub fn null() -> NullNode
pub fn string() -> StringNode
pub fn integer() -> IntegerNode
pub fn number() -> NumberNode
pub fn boolean() -> BooleanNode
pub fn object() -> ObjectNode
pub fn array<S: Into<SchemaNode>>(items: S) -> ArrayNode
Source§impl SchemaNode
impl SchemaNode
pub fn for_literal(literal_value: &JsValue) -> SchemaNode
Source§impl SchemaNode
impl SchemaNode
pub fn into_compiled(self) -> Result<SchemaCompiled, CompileError>
Source§impl SchemaNode
impl SchemaNode
pub fn coerce(&self, target: &SchemaNode) -> Result<Coercion, CoercionError>
Trait Implementations§
Source§impl Clone for SchemaNode
impl Clone for SchemaNode
Source§fn clone(&self) -> SchemaNode
fn clone(&self) -> SchemaNode
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SchemaNode
impl Debug for SchemaNode
Source§impl<'de> Deserialize<'de> for SchemaNode
impl<'de> Deserialize<'de> for SchemaNode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<AnyNode> for SchemaNode
impl From<AnyNode> for SchemaNode
Source§impl From<ArrayNode> for SchemaNode
impl From<ArrayNode> for SchemaNode
Source§impl From<BooleanNode> for SchemaNode
impl From<BooleanNode> for SchemaNode
Source§fn from(inner: BooleanNode) -> Self
fn from(inner: BooleanNode) -> Self
Converts to this type from the input type.
Source§impl From<IntegerNode> for SchemaNode
impl From<IntegerNode> for SchemaNode
Source§fn from(inner: IntegerNode) -> Self
fn from(inner: IntegerNode) -> Self
Converts to this type from the input type.
Source§impl From<NullNode> for SchemaNode
impl From<NullNode> for SchemaNode
Source§impl From<NumberNode> for SchemaNode
impl From<NumberNode> for SchemaNode
Source§fn from(inner: NumberNode) -> Self
fn from(inner: NumberNode) -> Self
Converts to this type from the input type.
Source§impl From<ObjectNode> for SchemaNode
impl From<ObjectNode> for SchemaNode
Source§fn from(inner: ObjectNode) -> Self
fn from(inner: ObjectNode) -> Self
Converts to this type from the input type.
Source§impl From<StringNode> for SchemaNode
impl From<StringNode> for SchemaNode
Source§fn from(inner: StringNode) -> Self
fn from(inner: StringNode) -> Self
Converts to this type from the input type.
Source§impl From<ValidNode> for SchemaNode
impl From<ValidNode> for SchemaNode
Source§impl Into<Result<ArrayNode, SchemaNode>> for SchemaNode
impl Into<Result<ArrayNode, SchemaNode>> for SchemaNode
Source§impl Into<Result<BooleanNode, SchemaNode>> for SchemaNode
impl Into<Result<BooleanNode, SchemaNode>> for SchemaNode
Source§fn into(self) -> Result<BooleanNode, SchemaNode>
fn into(self) -> Result<BooleanNode, SchemaNode>
Converts this type into the (usually inferred) input type.
Source§impl Into<Result<IntegerNode, SchemaNode>> for SchemaNode
impl Into<Result<IntegerNode, SchemaNode>> for SchemaNode
Source§fn into(self) -> Result<IntegerNode, SchemaNode>
fn into(self) -> Result<IntegerNode, SchemaNode>
Converts this type into the (usually inferred) input type.
Source§impl Into<Result<NullNode, SchemaNode>> for SchemaNode
impl Into<Result<NullNode, SchemaNode>> for SchemaNode
Source§impl Into<Result<NumberNode, SchemaNode>> for SchemaNode
impl Into<Result<NumberNode, SchemaNode>> for SchemaNode
Source§fn into(self) -> Result<NumberNode, SchemaNode>
fn into(self) -> Result<NumberNode, SchemaNode>
Converts this type into the (usually inferred) input type.
Source§impl Into<Result<ObjectNode, SchemaNode>> for SchemaNode
impl Into<Result<ObjectNode, SchemaNode>> for SchemaNode
Source§fn into(self) -> Result<ObjectNode, SchemaNode>
fn into(self) -> Result<ObjectNode, SchemaNode>
Converts this type into the (usually inferred) input type.
Source§impl Into<Result<StringNode, SchemaNode>> for SchemaNode
impl Into<Result<StringNode, SchemaNode>> for SchemaNode
Source§fn into(self) -> Result<StringNode, SchemaNode>
fn into(self) -> Result<StringNode, SchemaNode>
Converts this type into the (usually inferred) input type.
Source§impl PartialEq for SchemaNode
impl PartialEq for SchemaNode
Source§impl<'v> Query<'v> for SchemaNode
impl<'v> Query<'v> for SchemaNode
type Item = QueryNode<SchemaNode>
type ItemRef = QueryNode<&'v SchemaNode>
Source§fn lookup<'p, P>(&'v self, path: P) -> Option<Self::ItemRef>where
P: Path<'p>,
fn lookup<'p, P>(&'v self, path: P) -> Option<Self::ItemRef>where
P: Path<'p>,
Lookup for an element under the specified path.
Returns an optional reference to the sought element.
Source§fn take<'p, P>(self, path: P) -> (Option<Self>, Option<Self::Item>)where
P: Path<'p>,
fn take<'p, P>(self, path: P) -> (Option<Self>, Option<Self::Item>)where
P: Path<'p>,
Takes the element under the specified path out of the queried node.
Returns a tuple of two items: Read more
Source§fn insert<'p, P>(
&mut self,
path: P,
insertee: Self::Item,
) -> Result<(), Self::Item>where
P: Path<'p>,
fn insert<'p, P>(
&mut self,
path: P,
insertee: Self::Item,
) -> Result<(), Self::Item>where
P: Path<'p>,
Inserts an element into the queried node under the specified path.
Returns Ok(()) if inserted or Err(rejected_element) if could not perform insertion
(e.g. path leads to a child of a non-object sub-node).
Source§impl Serialize for SchemaNode
impl Serialize for SchemaNode
impl StructuralPartialEq 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 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
Mutably borrows from an owned value. Read more