pub struct Field {
pub name: String,
pub schema: Schema,
pub required: bool,
pub doc: String,
}Expand description
One field of a Schema::Record. doc is per field because that is what
:describe-option and :customize render beside it.
Fields§
§name: StringThe field’s key as a config file spells it. The derive kebab-cases the
Rust identifier (max_depth → max-depth) and strips a raw-identifier
prefix (r#match → match), so this is the wire name, not the Rust one.
schema: SchemaThe shape the field’s value must have.
required: boolDerived from the Rust type: an Option<T> field is optional, everything
else is required. That mapping is the whole reason the derive can decide
this without an attribute — the type already says it.
doc: StringThe field’s /// doc-comment, lines joined and trimmed; empty when the
field has none.
Trait Implementations§
impl Eq for Field
impl StructuralPartialEq for Field
Auto Trait Implementations§
impl Freeze for Field
impl RefUnwindSafe for Field
impl Send for Field
impl Sync for Field
impl Unpin for Field
impl UnsafeUnpin for Field
impl UnwindSafe for Field
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