[−][src]Enum jddf::schema::Form
The various forms which a schema may take on, and their respective data.
Variants
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.
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.
The properties form.
This schema asserts that the instance is an object, and that the properties all satisfy their respective schemas.
required
is the set of required properties and their schemas.
optional
is the set of optional properties and their schemas.
allow_additional
indicates whether it's acceptable for the instance to
have properties other than those mentioned in required
and optional
.
has_required
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.
Fields of Properties
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.
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 Clone for Form
[src]
impl Debug for Form
[src]
impl PartialEq<Form> for Form
[src]
impl StructuralPartialEq for Form
[src]
Auto Trait Implementations
impl RefUnwindSafe for Form
impl Send for Form
impl Sync for Form
impl Unpin for Form
impl UnwindSafe for Form
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
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>,