pub enum Constraint {
Enum {
values: Vec<Term>,
closed: bool,
},
Reference {
relation: String,
cardinality: Cardinality,
spanning: bool,
},
}Expand description
A value constraint on a field.
Variants§
Enum
A controlled vocabulary — an enumerated set of allowed values.
Fields
Reference
A relation / link field. The spanning (containment) backbone lives here.
Trait Implementations§
Source§impl Clone for Constraint
impl Clone for Constraint
Source§fn clone(&self) -> Constraint
fn clone(&self) -> Constraint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Constraint
impl Debug for Constraint
Source§impl Validate for Constraint
impl Validate for Constraint
Source§fn validate(&self, value: &Value) -> Validation
fn validate(&self, value: &Value) -> Validation
Only a controlled vocabulary constrains scalar values here; a reference or a type-only rule imposes nothing (fig’s reparse remains the backstop).
Auto Trait Implementations§
impl Freeze for Constraint
impl RefUnwindSafe for Constraint
impl Send for Constraint
impl Sync for Constraint
impl Unpin for Constraint
impl UnsafeUnpin for Constraint
impl UnwindSafe for Constraint
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