pub struct FieldSpec {
pub ty: Option<FieldType>,
pub values: OpenClosed,
pub vocabulary: Option<String>,
pub reify: bool,
}Expand description
A field declaration — an entry in the fields block. It promotes a
frontmatter field (tags, audience, created) that prov would otherwise
merely carry (DESIGN §2, tier 3) into something prov and its frontends know
the shape of. Two independent things can be declared, and a field needs at
least one of them to be worth an entry:
- A type (
ty) — what the value is. Pure data shape, decidable from the value alone, so it is spelled infig-schema’s vocabulary rather than one prov invents. - A vocabulary (
vocabulary) — which values are legal, turning the field into a resolvable reference prov keeps consistent: every value is checked against the vocabulary document the pointer reaches.
They compose (a closed vocabulary of strings is both), but neither implies
the other: created is a date with no vocabulary, and a vocabulary field
needs no declared type.
Fields§
§ty: Option<FieldType>The type the field’s values are expected to take, if declared. Drives
type-directed parsing and widget choice in a frontend (a date field
gets a date picker); prov itself carries it without interpreting it.
values: OpenClosedWhether the value set is open (folksonomy) or closed (must be known).
Meaningful only alongside a vocabulary.
vocabulary: Option<String>The pointer (a link) to the vocabulary document listing this field’s legal
terms — resolved like the registry/config pointers (DESIGN §6). None
for a field that declares a type but no controlled vocabulary.
reify: boolWhether each term is reified as its own node (rich: backlinks, a prose body, stable id) rather than a bare key in a flat registry. A hint to tooling; prov validates membership either way.
Trait Implementations§
impl Eq for FieldSpec
impl StructuralPartialEq for FieldSpec
Auto Trait Implementations§
impl Freeze for FieldSpec
impl RefUnwindSafe for FieldSpec
impl Send for FieldSpec
impl Sync for FieldSpec
impl Unpin for FieldSpec
impl UnsafeUnpin for FieldSpec
impl UnwindSafe for FieldSpec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.