Struct binate::prelude::Payload [−][src]
pub struct Payload { /* fields omitted */ }
Expand description
Payload of a RSocket frame.
Examples
use binate::prelude::*; let payload = Payload::builder().set_data("data").set_metadata("metadata").build(); assert_eq!(payload.data().unwrap(), "data"); assert_eq!(payload.metadata().unwrap(), "metadata");
Implementations
This is supported on crate feature frame
only.
frame
only.Returns a payload builder.
This is supported on crate feature frame
only.
frame
only.Returns the number of bytes in this payload.
This is supported on crate feature frame
only.
frame
only.Returns true if this payload is empty.
This is supported on crate feature frame
only.
frame
only.Returns the data
part of this payload.
This is supported on crate feature frame
only.
frame
only.Returns the metadata
part of this payload.
This is supported on crate feature frame
only.
frame
only.Returns the data
part of this payload in UTF-8 format, if the data
is valid UTF-8.
This is supported on crate feature frame
only.
frame
only.Returns the metadata
part of this payload in UTF-8 format, if the metadata
is valid UTF-8.
This is supported on crate feature frame
only.
frame
only.Returns true if this payload contains data
.
This is supported on crate feature frame
only.
frame
only.Returns true if this payload contains metadata
.
This is supported on crate feature frame
only.
frame
only.Splits the payload into Metadata
and Data
.
pub fn chunks(self, mtu: usize) -> PayloadChunksⓘNotable traits for PayloadChunks
impl Iterator for PayloadChunks type Item = Payload;
This is supported on crate feature frame
only.
pub fn chunks(self, mtu: usize) -> PayloadChunksⓘNotable traits for PayloadChunks
impl Iterator for PayloadChunks type Item = Payload;
frame
only.Returns a consuming iterator that yields mtu
bytes of the payload at a time (both
metadata
and data
are chunked by mtu
).
If mtu
does not divide the the metadata
and data
of the payload, then the last chunk
will not have length mtu
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Payload
impl UnwindSafe for Payload
Blanket Implementations
Mutably borrows from an owned value. Read more