pub struct Field {
pub name: String,
pub ty: TypeTag,
pub docs: &'static str,
pub optional: bool,
pub default: Option<Value>,
}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.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Field
impl Freeze for Field
impl Move 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.