Struct fizyr_rpc::PeerHandle[][src]

pub struct PeerHandle<Body> { /* fields omitted */ }
Expand description

Handle to a peer.

The handle can be used to receive incoming requests and stream messages, and to send requests and stream messages.

When the handle is dropped, the peer loop is stopped. Any open requests will also be terminated.

Implementations

Split the peer in a read handle and a write handle.

Splitting the peer allows you to move both handles into different tasks.

The original handle is consumed, but the peer loop will keep going until all read and write handles are dropped.

Receive the next request or stream message from the remote peer.

Errors for invalid incoming messages are also reported by this function. For example: incoming update messages that are not associated with a received request will be reported as an error here.

Send a new request to the remote peer.

Send a stream message to the remote peer.

Close the connection with the remote peer.

Make a close handle for the peer.

The close handle can be used to close the connection with the remote peer. It can be cloned and moved around independently.

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

Performs the conversion.

Performs the conversion.

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.