#[non_exhaustive]pub struct VocabularyDoc {
pub field: String,
pub closed: bool,
pub terms: Vec<Term>,
}Expand description
A controlled vocabulary loaded from its own document: the field it
governs, whether its value set is closed, and the terms themselves — ready
to hand to validate_enum.
#[non_exhaustive]: the document convention can gain declared facts, so
build one with VocabularyDoc::new. Reading the fields is unchanged.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.field: StringThe field this vocabulary governs (audience, tags).
closed: boolWhether the value set is closed (an unknown value is a hard
Validation::Reject) or open (a folksonomy — an unknown value only
Validation::Warns, as a possible typo). Any values spelling other
than "closed" is open, matching validate_enum’s own permissive
default.
terms: Vec<Term>The declared terms, in declaration order.
Implementations§
Trait Implementations§
Source§impl Clone for VocabularyDoc
impl Clone for VocabularyDoc
Source§fn clone(&self) -> VocabularyDoc
fn clone(&self) -> VocabularyDoc
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 VocabularyDoc
impl Debug for VocabularyDoc
Source§impl PartialEq for VocabularyDoc
impl PartialEq for VocabularyDoc
impl StructuralPartialEq for VocabularyDoc
Auto Trait Implementations§
impl Freeze for VocabularyDoc
impl RefUnwindSafe for VocabularyDoc
impl Send for VocabularyDoc
impl Sync for VocabularyDoc
impl Unpin for VocabularyDoc
impl UnsafeUnpin for VocabularyDoc
impl UnwindSafe for VocabularyDoc
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