pub struct Transit {
    pub skey: Key<TransitTxKey>,
    pub rkey: Key<TransitRxKey>,
    pub snonce: Nonce,
    pub rnonce: Nonce,
    /* private fields */
}
Expand description

An established Transit connection.

While you can manually send and receive bytes over the TCP stream, this is not recommended as the transit protocol also specifies an encrypted record pipe that does all the hard work for you. See the provided methods.

Fields

skey: Key<TransitTxKey>

Our key, used for sending

rkey: Key<TransitRxKey>

Their key, used for receiving

snonce: Nonce

Nonce for sending

rnonce: Nonce

Nonce for receiving

We’ll count as receiver and track if messages come in in order

Implementations

Receive and decrypt one message from the other side.

Send an encrypted message to the other side

Convert the transit connection to a [Stream]/[Sink] pair

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.