Struct yamux::Control [−][src]
pub struct Control { /* fields omitted */ }The Yamux Connection controller.
While a Yamux connection makes progress via its next_stream method,
this controller can be used to concurrently direct the connection,
e.g. to open a new stream to the remote or to close the connection.
The possible operations are implemented as async methods and redundantly as poll-based variants which may be useful inside of other poll based environments such as certain trait implementations.
Implementations
impl Control[src]
impl Control[src]pub async fn open_stream(&mut self) -> Result<Stream, ConnectionError>[src]
Open a new stream to the remote.
pub async fn close(&mut self) -> Result<(), ConnectionError>[src]
Close the connection.
pub fn poll_open_stream(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<Stream, ConnectionError>>[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<Stream, ConnectionError>>
Poll based alternative to Control::open_stream.
pub fn abort_open_stream(&mut self)[src]
Abort an ongoing open stream operation started by poll_open_stream.
pub fn poll_close(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<(), ConnectionError>>[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<(), ConnectionError>>
Poll based alternative to Control::close.