pub struct DataType {
pub name: CowStr,
pub docs: Option<CowStr>,
pub fields: Cow<'static, [Field]>,
pub encoding_format: DataFormat,
}Expand description
In-memory representation of a single
data type in a Pact.
Fields§
§name: CowStrName of the data type.
docs: Option<CowStr>Top-level documentation for the data type.
fields: Cow<'static, [Field]>All fields comprising the data type, in ascending order by their ordinals.
encoding_format: DataFormatEncoding format of the data type.
Implementations§
source§impl DataType
impl DataType
sourcepub fn new(name: impl IntoCowStr, ordinal: FormatMetadata) -> Self
pub fn new(name: impl IntoCowStr, ordinal: FormatMetadata) -> Self
Returns a new, empty data type with
name and ordinal.
sourcepub fn with_docs(self, docs: impl IntoCowStr) -> Self
pub fn with_docs(self, docs: impl IntoCowStr) -> Self
Returns self with docs, replacing any existing docs.
sourcepub fn with_field(self, field: Field) -> Self
pub fn with_field(self, field: Field) -> Self
Returns self with an additional field.
Trait Implementations§
source§impl PartialEq for DataType
impl PartialEq for DataType
impl StructuralPartialEq for DataType
Auto Trait Implementations§
impl Freeze for DataType
impl RefUnwindSafe for DataType
impl Send for DataType
impl Sync for DataType
impl Unpin for DataType
impl UnwindSafe for DataType
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