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.

Returns a payload builder.

This is supported on crate feature frame only.

Returns the number of bytes in this payload.

This is supported on crate feature frame only.

Returns true if this payload is empty.

This is supported on crate feature frame only.

Returns the data part of this payload.

This is supported on crate feature frame only.

Returns the metadata part of this payload.

This is supported on crate feature 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.

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.

Returns true if this payload contains data.

This is supported on crate feature frame only.

Returns true if this payload contains metadata.

This is supported on crate feature frame only.

Splits the payload into Metadata and Data.

This is supported on crate feature 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

Returns a copy of the value. Read more

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

Encodes self into bytes.

Returns the length (in bytes) of this value.

Returns whether this value is empty.

Encodes self into bytes. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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.