pub struct Field {
pub name: String,
pub ty: TypeTag,
pub docs: &'static str,
pub optional: bool,
pub default: Option<Value>,
pub alias: Option<String>,
}Expand description
One named field of a TypeTag::Record schema.
Fields§
§name: StringField key as it appears in the value map. Owned: schema names arrive from runtime spellings, so interning them would leak per distinct spelling.
ty: TypeTagExpected type of the field value. Nests freely.
docs: &'static strWhat the field carries. Hand-registered schemas document every field; fields synthesized from inline spellings carry none.
optional: boolOptional fields (MAP<permit?: PERMIT>) may be absent: missing
optional keys pass, missing required keys fail, extra keys
always fail. A default (MAP<retries: INT = 2>) fills when
absent: defaults satisfy every binding check, and readers
never observe the hole.
default: Option<Value>Fill value for absent fields (None when the shape carries
none). Materialized where the alias resolves and checked
against the field type there, so ill-typed defaults fail
naming the declaration.
alias: Option<String>Alternate CLI spelling (MAP<h: BOOL ALIAS help>): accepted on
the command line, canonical key stays name in the parsed map.
None for ordinary fields and every hand-registered schema.