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.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Field
impl Freeze for Fieldwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<TypeTag> is !null: Freeze,
PhantomData<ArcInner<TypeTag>>: Freeze,
&'static TypeDescriptor: Freeze,
*const ArcInner<[Field]> is !null: Freeze,
PhantomData<ArcInner<[Field]>>: Freeze,
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
*const ArcInner<[TypeTag]> is !null: Freeze,
PhantomData<ArcInner<[TypeTag]>>: Freeze,
&'static str: Freeze,
*mut (): Freeze,
impl Move for Field
impl RefUnwindSafe for Field
impl Send for Field
impl Sync for Field
impl Unpin for Field
impl UnsafeUnpin for Fieldwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<TypeTag> is !null: UnsafeUnpin,
PhantomData<ArcInner<TypeTag>>: UnsafeUnpin,
&'static TypeDescriptor: UnsafeUnpin,
*const ArcInner<[Field]> is !null: UnsafeUnpin,
PhantomData<ArcInner<[Field]>>: UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const ArcInner<[TypeTag]> is !null: UnsafeUnpin,
PhantomData<ArcInner<[TypeTag]>>: UnsafeUnpin,
&'static str: UnsafeUnpin,
*mut (): UnsafeUnpin,
impl UnwindSafe for Fieldwhere
RawVecInner: UnwindSafe,
Arc<TypeTag>: UnwindSafe,
&'static TypeDescriptor: UnwindSafe,
Arc<[Field]>: UnwindSafe,
Arc<str>: UnwindSafe,
Arc<[TypeTag]>: UnwindSafe,
&'static str: UnwindSafe,
*mut (): UnwindSafe,
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.