[−][src]Enum jsl::schema::Form
The various forms which a schema may take on, and their respective data.
Variants
Empty
The empty form.
This schema accepts all data.
Ref(String)
The ref form.
This schema refers to another schema, and does whatever that other
schema does. The contained string is the name of the definition of the
referred-to schema -- it is an index into the defs
of the root schema.
Type(Type)
The type form.
This schema asserts that the data is one of the primitive types.
Enum(HashSet<String>)
The enum form.
This schema asserts that the data is a string, and that it is one of a set of values.
Elements(Schema)
The elements form.
This schema asserts that the instance is an array, and that every element of the array matches a given schema.
Properties(HashMap<String, Schema>, HashMap<String, Schema>, bool)
The properties form.
This schema asserts that the instance is an object, and that the properties all satisfy their respective schemas.
The first map is the set of required properties and their schemas. The second map is the set of optional properties and their schemas.
The final property indicates whether properties
exists on the schema.
This allows implementations to distinguish the case of an empty
properties
field from an omitted one. This is necessary for tooling
which wants to link to a particular part of a schema in JSON form.
Values(Schema)
The values form.
This schema asserts that the instance is an object, and that all the values in the object all satisfy the same schema.
Discriminator(String, HashMap<String, Schema>)
The discriminator form.
This schema asserts that the instance is an object, and that it has a "tag" property. The value of that tag must be one of the expected "mapping" keys, and the corresponding mapping value is a schema that the instance is expected to satisfy.
The first parameter is the name of the tag property. The second parameter is the mapping from tag values to their corresponding schemas.
Trait Implementations
impl PartialEq<Form> for Form
[src]
impl Clone for Form
[src]
fn clone(&self) -> Form
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Form
[src]
Auto Trait Implementations
impl Send for Form
impl Unpin for Form
impl Sync for Form
impl UnwindSafe for Form
impl RefUnwindSafe for Form
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,