pub struct InmemoryTransport { /* private fields */ }
Expand description

Represents a Transport comprised of two inmemory channels

Implementations

Creates a new transport where tx is used to send data out of the transport during try_write and rx is used to receive data into the transport during try_read.

Returns (incoming_tx, outgoing_rx, transport) where incoming_tx is used to send data to the transport where it will be consumed during try_read and outgoing_rx is used to receive data from the transport when it is written using try_write.

Returns pair of transports that are connected such that one sends to the other and vice versa

Links two independent InmemoryTransport together by dropping their internal channels and generating new ones of buffer capacity to connect these transports.

Note

This will drop any pre-existing data in the internal storage to avoid corruption.

Trait Implementations

Formats the value using the given formatter. Read more

Once the underlying channels have closed, there is no way for this transport to re-establish those channels; therefore, reconnecting will fail with ErrorKind::ConnectionRefused if either underlying channel has closed.

Tries to read data from the transport into the provided buffer, returning how many bytes were read. Read more
Try to write a buffer to the transport, returning how many bytes were written. Read more
Waits for the transport to be ready based on the given interest, returning the ready status. Read more

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.

Should always be Self
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.