pub struct Transport<T, U>(_) 
where
    T: DataStream,
    U: Codec
;
Expand description

Represents a transport of data across the network

Implementations

Produces a pair of inmemory transports that are connected to each other using a standard codec

Sets the buffer for message passing for each underlying stream to the given buffer size

Establishes a connection to one of the specified addresses and uses the provided codec for transportation

Returns the address of the peer the transport is connected to

Establishes a connection to the socket at the specified path and uses the provided codec for transportation

Returns the address of the peer the transport is connected to

Creates a new instance of the transport, wrapping the stream in a Framed<T, XChaCha20Poly1305Codec>

Sends some data across the wire, waiting for it to completely send

Receives some data from out on the wire, waiting until it’s available, returning none if the transport is now closed

Returns a textual description of the transport’s underlying connection

Returns a reference to the underlying I/O stream

Note that care should be taken to not tamper with the underlying stream of data coming in as it may corrupt the stream of frames otherwise being worked with

Returns a reference to the underlying I/O stream

Note that care should be taken to not tamper with the underlying stream of data coming in as it may corrupt the stream of frames otherwise being worked with

Consumes the transport, returning its underlying I/O stream

Note that care should be taken to not tamper with the underlying stream of data coming in as it may corrupt the stream of frames otherwise being worked with.

Splits transport into read and write halves

Trait Implementations

Formats the value using the given formatter. 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.