Struct iota_client::block::payload::TaggedDataPayload
source · pub struct TaggedDataPayload { /* private fields */ }
Expand description
A payload which holds a tag and associated data.
Implementations§
source§impl TaggedDataPayload
impl TaggedDataPayload
sourcepub const KIND: u32 = 5u32
pub const KIND: u32 = 5u32
The payload kind of a TaggedDataPayload
.
sourcepub const TAG_LENGTH_RANGE: RangeInclusive<u8> = #[lang = "range_inclusive_new"](0, 64)
pub const TAG_LENGTH_RANGE: RangeInclusive<u8> = #[lang = "range_inclusive_new"](0, 64)
Valid lengths for the tag.
sourcepub const DATA_LENGTH_RANGE: RangeInclusive<u32> = #[lang = "range_inclusive_new"](0,
(Block::LENGTH_MAX - Block::LENGTH_MIN - 9) as u32)
pub const DATA_LENGTH_RANGE: RangeInclusive<u32> = #[lang = "range_inclusive_new"](0, (Block::LENGTH_MAX - Block::LENGTH_MIN - 9) as u32)
Valid lengths for the data.
sourcepub fn new(
tag: Vec<u8, Global>,
data: Vec<u8, Global>
) -> Result<TaggedDataPayload, Error>
pub fn new(
tag: Vec<u8, Global>,
data: Vec<u8, Global>
) -> Result<TaggedDataPayload, Error>
Creates a new TaggedDataPayload
.
sourcepub fn tag(&self) -> &[u8] ⓘ
pub fn tag(&self) -> &[u8] ⓘ
Returns the tag of a TaggedDataPayload
.
sourcepub fn data(&self) -> &[u8] ⓘ
pub fn data(&self) -> &[u8] ⓘ
Returns the data of a TaggedDataPayload
.
Trait Implementations§
source§impl Clone for TaggedDataPayload
impl Clone for TaggedDataPayload
source§fn clone(&self) -> TaggedDataPayload
fn clone(&self) -> TaggedDataPayload
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TaggedDataPayload
impl Debug for TaggedDataPayload
source§impl<'de> Deserialize<'de> for TaggedDataPayload
impl<'de> Deserialize<'de> for TaggedDataPayload
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<TaggedDataPayload, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<TaggedDataPayload, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<&TaggedDataPayload> for TaggedDataPayloadDto
impl From<&TaggedDataPayload> for TaggedDataPayloadDto
source§fn from(value: &TaggedDataPayload) -> TaggedDataPayloadDto
fn from(value: &TaggedDataPayload) -> TaggedDataPayloadDto
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 Packable for TaggedDataPayload
impl Packable for TaggedDataPayload
§type UnpackError = Error
type UnpackError = Error
The error type that can be returned if some semantic error occurs while unpacking. Read more
§type UnpackVisitor = <BoxedSlicePrefix<u8, BoundedU8<_, _>> as Packable>::UnpackVisitor
type UnpackVisitor = <BoxedSlicePrefix<u8, BoundedU8<_, _>> as Packable>::UnpackVisitor
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: &<TaggedDataPayload as Packable>::UnpackVisitor
) -> Result<TaggedDataPayload, UnpackError<<TaggedDataPayload as Packable>::UnpackError, <U as Unpacker>::Error>>where
U: Unpacker,
fn unpack<U, const VERIFY: bool>(
unpacker: &mut U,
visitor: &<TaggedDataPayload as Packable>::UnpackVisitor
) -> Result<TaggedDataPayload, UnpackError<<TaggedDataPayload 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<TaggedDataPayload> for TaggedDataPayload
impl PartialEq<TaggedDataPayload> for TaggedDataPayload
source§fn eq(&self, other: &TaggedDataPayload) -> bool
fn eq(&self, other: &TaggedDataPayload) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for TaggedDataPayload
impl Serialize for TaggedDataPayload
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
source§impl TryFrom<&TaggedDataPayloadDto> for TaggedDataPayload
impl TryFrom<&TaggedDataPayloadDto> for TaggedDataPayload
source§fn try_from(
value: &TaggedDataPayloadDto
) -> Result<TaggedDataPayload, <TaggedDataPayload as TryFrom<&TaggedDataPayloadDto>>::Error>
fn try_from(
value: &TaggedDataPayloadDto
) -> Result<TaggedDataPayload, <TaggedDataPayload as TryFrom<&TaggedDataPayloadDto>>::Error>
Performs the conversion.
impl Eq for TaggedDataPayload
impl StructuralEq for TaggedDataPayload
impl StructuralPartialEq for TaggedDataPayload
Auto Trait Implementations§
impl RefUnwindSafe for TaggedDataPayload
impl Send for TaggedDataPayload
impl Sync for TaggedDataPayload
impl Unpin for TaggedDataPayload
impl UnwindSafe for TaggedDataPayload
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
.