pub trait AsyncWriteSendStreamExtra: Send {
// Required methods
fn inner(&mut self) -> &mut (impl AsyncWrite + Unpin + Send);
fn reset(&mut self, code: VarInt) -> Result<()>;
fn stopped(&mut self) -> impl Future<Output = Result<Option<VarInt>>> + Send;
fn id(&self) -> u64;
}
Expand description
This is a helper trait to work with AsyncWriteSendStream
.
If you have an AsyncWrite + Unpin + Send
, you can implement these additional
methods and wrap the result in an AsyncWriteSendStream
to get a SendStream
that writes to the underlying AsyncWrite
.
Required Methods§
Sourcefn inner(&mut self) -> &mut (impl AsyncWrite + Unpin + Send)
fn inner(&mut self) -> &mut (impl AsyncWrite + Unpin + Send)
Get a mutable reference to the inner AsyncWrite
.
Getting a reference is easier than implementing all methods on AsyncWrite
with forwarders to the inner instance.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.