Struct Payload Copy item path
Summary Source pub struct Payload(pub Vec <Bytes >);
Expand description A packet payload containing a list of byte chunks.
The sum of the lengths of each chunk must be at most u32::MAX
, otherwise operations on the
payload or other code using the payload may panic.
Returns the number of bytes in the payload.
Returns true if the payload has no data (no byte chunks or only empty byte chunks).
Concatenate the byte chunks into a single byte chunk. Unless the payload is empty or has a
single chunk, this will allocate a large buffer and copy all of the individual chunks to
this new buffer.
Performs copy-assignment from
source
.
Read more Formats the value using the given formatter.
Read more Returns the “default value” for a type.
Read more Converts to this type from the input type.
Converts to this type from the input type.
Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit
)
Performs copy-assignment from
self
to
dst
.
Read more Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From <T> for U
chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.