#[non_exhaustive]pub struct FieldSpec {
pub name: Cow<'static, str>,
pub kind: FieldKind,
pub required: bool,
pub records: bool,
pub default: Option<Cow<'static, str>>,
pub primary: bool,
pub description: Option<Cow<'static, str>>,
}Expand description
One field of a config.
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.name: Cow<'static, str>The authored key.
kind: FieldKindWhat the field is.
required: boolIs the key required?
records: boolDoes the engine record the field’s result? Always for a field holding an output.
default: Option<Cow<'static, str>>The default, as JSON text.
primary: boolIs this the primary output?
description: Option<Cow<'static, str>>The field’s doc comment.
Implementations§
Source§impl FieldSpec
impl FieldSpec
Sourcepub fn runtime(
name: impl Into<Cow<'static, str>>,
kind: FieldKind,
required: bool,
) -> Self
pub fn runtime( name: impl Into<Cow<'static, str>>, kind: FieldKind, required: bool, ) -> Self
A runtime field: its kind is an expression, an interpolated document, a literal or an output. It records when it holds an output.
Sourcepub fn with_default(self, json: impl Into<Cow<'static, str>>) -> Self
pub fn with_default(self, json: impl Into<Cow<'static, str>>) -> Self
Sets the default, as JSON text.
Trait Implementations§
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
Mutably borrows from an owned value. Read more