Enum iota_client::block::payload::Payload
source · pub enum Payload {
Transaction(Box<TransactionPayload, Global>),
Milestone(Box<MilestonePayload, Global>),
TreasuryTransaction(Box<TreasuryTransactionPayload, Global>),
TaggedData(Box<TaggedDataPayload, Global>),
}
Expand description
A generic payload that can represent different types defining block payloads.
Variants§
Transaction(Box<TransactionPayload, Global>)
A transaction payload.
Milestone(Box<MilestonePayload, Global>)
A milestone payload.
TreasuryTransaction(Box<TreasuryTransactionPayload, Global>)
A treasury transaction payload.
TaggedData(Box<TaggedDataPayload, Global>)
A tagged data payload.
Implementations§
source§impl Payload
impl Payload
pub fn try_from_dto(
value: &PayloadDto,
protocol_parameters: &ProtocolParameters
) -> Result<Payload, DtoError>
pub fn try_from_dto_unverified(value: &PayloadDto) -> Result<Payload, DtoError>
Trait Implementations§
source§impl<'de> Deserialize<'de> for Payload
impl<'de> Deserialize<'de> for Payload
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Payload, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Payload, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<&Payload> for PayloadDto
impl From<&Payload> for PayloadDto
source§fn from(value: &Payload) -> PayloadDto
fn from(value: &Payload) -> PayloadDto
Converts to this type from the input type.
source§impl From<MilestonePayload> for Payload
impl From<MilestonePayload> for Payload
source§fn from(payload: MilestonePayload) -> Payload
fn from(payload: MilestonePayload) -> Payload
Converts to this type from the input type.
source§impl From<TaggedDataPayload> for Payload
impl From<TaggedDataPayload> for Payload
source§fn from(payload: TaggedDataPayload) -> Payload
fn from(payload: TaggedDataPayload) -> Payload
Converts to this type from the input type.
source§impl From<TransactionPayload> for Payload
impl From<TransactionPayload> for Payload
source§fn from(payload: TransactionPayload) -> Payload
fn from(payload: TransactionPayload) -> Payload
Converts to this type from the input type.
source§impl From<TreasuryTransactionPayload> for Payload
impl From<TreasuryTransactionPayload> for Payload
source§fn from(payload: TreasuryTransactionPayload) -> Payload
fn from(payload: TreasuryTransactionPayload) -> Payload
Converts to this type from the input type.
source§impl Packable for Payload
impl Packable for Payload
§type UnpackError = Error
type UnpackError = Error
The error type that can be returned if some semantic error occurs while unpacking. Read more
§type UnpackVisitor = ProtocolParameters
type UnpackVisitor = ProtocolParameters
FIXME: docs
source§fn pack<P>(&self, packer: &mut P) -> Result<(), <P as Packer>::Error>where
P: Packer,
fn pack<P>(&self, packer: &mut P) -> Result<(), <P as Packer>::Error>where
P: Packer,
Packs this value into the given
Packer
.source§fn unpack<U, const VERIFY: bool>(
unpacker: &mut U,
visitor: &<Payload as Packable>::UnpackVisitor
) -> Result<Payload, UnpackError<<Payload as Packable>::UnpackError, <U as Unpacker>::Error>>where
U: Unpacker,
fn unpack<U, const VERIFY: bool>(
unpacker: &mut U,
visitor: &<Payload as Packable>::UnpackVisitor
) -> Result<Payload, UnpackError<<Payload as Packable>::UnpackError, <U as Unpacker>::Error>>where
U: Unpacker,
Unpacks this value from the given
Unpacker
. The VERIFY
generic parameter can be used to skip additional
syntactic checks.source§impl PartialEq<Payload> for Payload
impl PartialEq<Payload> for Payload
source§impl Serialize for Payload
impl Serialize for Payload
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for Payload
impl StructuralEq for Payload
impl StructuralPartialEq for Payload
Auto Trait Implementations§
impl RefUnwindSafe for Payload
impl Send for Payload
impl Sync for Payload
impl Unpin for Payload
impl UnwindSafe for Payload
Blanket Implementations§
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<P> PackableExt for Pwhere
P: Packable,
impl<P> PackableExt for Pwhere
P: Packable,
source§fn unpack_verified<T>(
bytes: T,
visitor: &<P as Packable>::UnpackVisitor
) -> Result<P, UnpackError<<P as Packable>::UnpackError, UnexpectedEOF>>where
T: AsRef<[u8]>,
fn unpack_verified<T>(
bytes: T,
visitor: &<P as Packable>::UnpackVisitor
) -> Result<P, UnpackError<<P as Packable>::UnpackError, UnexpectedEOF>>where
T: AsRef<[u8]>,
Unpacks this value from a type that implements [AsRef<[u8]>
].
source§fn unpack_unverified<T>(
bytes: T
) -> Result<P, UnpackError<<P as Packable>::UnpackError, UnexpectedEOF>>where
T: AsRef<[u8]>,
fn unpack_unverified<T>(
bytes: T
) -> Result<P, UnpackError<<P as Packable>::UnpackError, UnexpectedEOF>>where
T: AsRef<[u8]>,
Unpacks this value from a type that implements [AsRef<[u8]>
] skipping some syntatical checks.
source§fn packed_len(&self) -> usize
fn packed_len(&self) -> usize
Returns the length in bytes of the value after being packed. The returned value always matches the number of
bytes written using
pack
.