pub struct DataField {
pub name: Text,
pub docs: Option<Text>,
pub typing: Type,
pub optional: bool,
pub flattened: bool,
}Expand description
A field in a DataType.
Fields§
§name: TextName of the field.
docs: Option<Text>Markdown-formatted documentation of the field.
typing: TypeType of the field.
optional: boolTrue if the field is semantically optional.
flattened: boolTrue if the field is semantically flattened.
This property has no effect on the encoding, decoding, or in-language representation of a field; it’s an informational marker that some marshallers (like JSON) may use to enable compatibility between coda-defined data and legacy systems.
Trait Implementations§
Source§impl Decodable for DataField
impl Decodable for DataField
Source§fn decode(
&mut self,
reader: &mut (impl ReadsDecodable + ?Sized),
header: Option<DataHeader>,
) -> Result<(), CodecError>
fn decode( &mut self, reader: &mut (impl ReadsDecodable + ?Sized), header: Option<DataHeader>, ) -> Result<(), CodecError>
Source§fn ensure_header(
header: Option<DataHeader>,
supported_ordinals: &[u8],
) -> Result<DataHeader, CodecError>
fn ensure_header( header: Option<DataHeader>, supported_ordinals: &[u8], ) -> Result<DataHeader, CodecError>
Returns
Ok(header) iff header exists
and matches one of suppported_ordinals.Source§fn ensure_no_header(header: Option<DataHeader>) -> Result<(), CodecError>
fn ensure_no_header(header: Option<DataHeader>) -> Result<(), CodecError>
Returns
Ok(()) iff header is None.Source§impl Encodable for DataField
impl Encodable for DataField
Source§fn encode(
&self,
writer: &mut (impl WritesEncodable + ?Sized),
) -> Result<(), CodecError>
fn encode( &self, writer: &mut (impl WritesEncodable + ?Sized), ) -> Result<(), CodecError>
Source§fn encode_header(
&self,
writer: &mut (impl WritesEncodable + ?Sized),
) -> Result<(), CodecError>
fn encode_header( &self, writer: &mut (impl WritesEncodable + ?Sized), ) -> Result<(), CodecError>
Encodes this thing’s data header into
writer. Read moreimpl StructuralPartialEq for DataField
Auto Trait Implementations§
impl Freeze for DataField
impl RefUnwindSafe for DataField
impl Send for DataField
impl Sync for DataField
impl Unpin for DataField
impl UnsafeUnpin for DataField
impl UnwindSafe for DataField
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,
Source§impl<T> TryAsFormat<T> for T
impl<T> TryAsFormat<T> for T
Source§type Error = Infallible
type Error = Infallible
Source§fn try_as_format(&self) -> Result<&T, <T as TryAsFormat<T>>::Error>
fn try_as_format(&self) -> Result<&T, <T as TryAsFormat<T>>::Error>
Returns a
D-formatted reference to the data.