pub struct ObjectDef {
pub fields: Vec<FieldDef>,
pub closed: bool,
pub strips: bool,
pub additional: Option<Box<ShapeDef>>,
pub any_of_keys: Vec<String>,
pub one_of_keys: Vec<String>,
pub min_properties: Option<usize>,
pub dependent_required: Vec<(String, Vec<String>)>,
}Expand description
An object with named fields.
Fields§
§fields: Vec<FieldDef>§closed: boolWhether a key outside fields is refused.
strips: boolWhether a closed object’s validation lets a key outside fields pass instead of refusing it. The schema and the
declarations still say the object is closed, and building the value drops the key, so a document that has one is
read as the object without it. It has no effect on an object that is not closed.
additional: Option<Box<ShapeDef>>The shape of the value of a key outside fields, for an object that holds any key but types its value.
any_of_keys: Vec<String>When not empty, at least one of these keys is present.
one_of_keys: Vec<String>When not empty, exactly one of these keys is present.
min_properties: Option<usize>§dependent_required: Vec<(String, Vec<String>)>For each key, the keys that must be present whenever it is.
Trait Implementations§
impl StructuralPartialEq for ObjectDef
Auto Trait Implementations§
impl Forget for ObjectDef
impl Freeze for ObjectDef
impl Move for ObjectDef
impl RefUnwindSafe for ObjectDef
impl Send for ObjectDef
impl Sync for ObjectDef
impl Unpin for ObjectDef
impl UnsafeUnpin for ObjectDef
impl UnwindSafe for ObjectDef
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