pub struct Message<T> { /* private fields */ }
Expand description

A wrapped message which may be either typed or binary data.

Implementations

Wrap a typed item as a message.

Wrap a shared typed item as a message.

Destructures and returns any typed data.

Returns a mutable reference, if typed.

Returns an immutable or mutable typed reference.

This method returns a mutable reference if the underlying data are typed Rust instances, which admit mutation, and it returns an immutable reference if the data are serialized binary data.

Wrap bytes as a message.

The number of bytes required to serialize the data.

Writes the binary representation into writer.

Produces a typed instance of the wrapped element.

Ensures the message is typed data and returns a mutable reference to it.

Trait Implementations

The resulting type after dereferencing.

Dereferences the value.

Pulls an element and provides the opportunity to take ownership. Read more

Takes an Option<T> and leaves None behind.

Pulls an element and provides the opportunity to take ownership. Read more

Takes an Option<T> and leaves None behind.

Pushes element with the opportunity to take ownership.

Pushes element and drops any resulting resources.

Pushes None, conventionally signalling a flush.

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

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 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.