pub struct SchemaField {
pub name: String,
pub schema: ConfigSchema,
pub required: bool,
pub doc: String,
}Expand description
One field of a ConfigSchema::Record.
doc is carried per field rather than only per option because that is what
:describe-option and :customize render beside the field — an option-level
doc string describing six fields is the wall of prose the schema exists to
replace.
Fields§
§name: StringThe field’s key in the record (and in TOML). Matched exactly.
schema: ConfigSchemaThe shape the field’s value must have.
required: boolA missing required field is a validation error naming its path; a missing optional one is simply absent from the value.
doc: StringPer-field help rendered beside the field.
Implementations§
Trait Implementations§
Source§impl Clone for SchemaField
impl Clone for SchemaField
Source§fn clone(&self) -> SchemaField
fn clone(&self) -> SchemaField
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 SchemaField
impl Debug for SchemaField
impl Eq for SchemaField
Source§impl PartialEq for SchemaField
impl PartialEq for SchemaField
impl StructuralPartialEq for SchemaField
Auto Trait Implementations§
impl Freeze for SchemaField
impl RefUnwindSafe for SchemaField
impl Send for SchemaField
impl Sync for SchemaField
impl Unpin for SchemaField
impl UnsafeUnpin for SchemaField
impl UnwindSafe for SchemaField
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.