pub enum Datum {
IntegerDatum(BigInt),
ByteStringDatum(Vec<u8>),
ConstructorDatum {
constructor: u64,
fields: Vec<Datum>,
},
ListDatum(Vec<Datum>),
MapDatum(Vec<MapDatumEntry>),
}
Expand description
Plutus datum type
Variants§
IntegerDatum(BigInt)
Integer value
ByteStringDatum(Vec<u8>)
Byte string value
ConstructorDatum
Constructor value
A Plutus constructor datum consists of an ordered list of Plutus field values together
with numeric constructor ID that marks the constructor variant used. These can only be
interpreted against an external schema that specifies expected content of fields
and
their interpretation.
ListDatum(Vec<Datum>)
List of values
MapDatum(Vec<MapDatumEntry>)
Key-value mapping
Implementations§
Source§impl Datum
impl Datum
Sourcepub fn as_bytestring(&self) -> Option<&Vec<u8>>
pub fn as_bytestring(&self) -> Option<&Vec<u8>>
Returns byte content if self
is a Datum::ByteStringDatum and None otherwise.
Trait Implementations§
impl StructuralPartialEq for Datum
Auto Trait Implementations§
impl Freeze for Datum
impl RefUnwindSafe for Datum
impl Send for Datum
impl Sync for Datum
impl Unpin for Datum
impl UnwindSafe for Datum
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