pub enum WriteTransport<W: AsyncWrite + Unpin + Send + Sync> {
V1(W, Network),
V2(ProtocolWriter<W>),
}Variants§
Implementations§
Source§impl<W> WriteTransport<W>
impl<W> WriteTransport<W>
Sourcepub async fn write_message(
&mut self,
message: NetworkMessage,
) -> Result<(), TransportError>
pub async fn write_message( &mut self, message: NetworkMessage, ) -> Result<(), TransportError>
Write a [NetworkMessage] to the transport’s [ProtocolWriter] buffer.
Sourcepub async fn shutdown(&mut self) -> Result<(), TransportError>
pub async fn shutdown(&mut self) -> Result<(), TransportError>
Shutdown the transport.
Auto Trait Implementations§
impl<W> Freeze for WriteTransport<W>where
W: Freeze,
impl<W> RefUnwindSafe for WriteTransport<W>where
W: RefUnwindSafe,
impl<W> Send for WriteTransport<W>
impl<W> Sync for WriteTransport<W>
impl<W> Unpin for WriteTransport<W>
impl<W> UnwindSafe for WriteTransport<W>where
W: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more