[][src]Struct jsl::schema::Schema

pub struct Schema { /* fields omitted */ }

An abstract representation of a JSL schema.

This struct is meant for use by validators, code generators, or other high-level processors of schemas. For serialization and deserialization of schemas, instead use Serde.

Methods

impl Schema[src]

pub fn from_serde(serde_schema: Serde) -> Result<Self, Error>[src]

Construct a new, root schema from a Serde.

pub fn is_root(&self) -> bool[src]

Is this schema a root schema?

Under the hood, this is entirely equivalent to checking whether defs().is_some().

pub fn definitions(&self) -> &Option<HashMap<String, Schema>>[src]

Get the definitions associated with this schema.

If this schema is non-root, this returns None.

pub fn form(&self) -> &Form[src]

Get the form of the schema.

Trait Implementations

impl PartialEq<Schema> for Schema[src]

impl Clone for Schema[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Schema[src]

Auto Trait Implementations

impl Send for Schema

impl Sync for Schema

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]