Struct stubborn_io::tokio::StubbornIo
source · pub struct StubbornIo<T, C> { /* private fields */ }
Expand description
The StubbornIo is a wrapper over a tokio AsyncRead/AsyncWrite item that will automatically invoke the UnderlyingIo::establish upon initialization and when a reconnect is needed. Because it implements deref, you are able to invoke all of the original methods on the wrapped IO.
Implementations§
source§impl<T, C> StubbornIo<T, C>
impl<T, C> StubbornIo<T, C>
sourcepub async fn connect(ctor_arg: C) -> Result<Self>
pub async fn connect(ctor_arg: C) -> Result<Self>
Connects or creates a handle to the UnderlyingIo item, using the default reconnect options.
pub async fn connect_with_options( ctor_arg: C, options: ReconnectOptions ) -> Result<Self>
Trait Implementations§
source§impl<T, C> AsyncRead for StubbornIo<T, C>
impl<T, C> AsyncRead for StubbornIo<T, C>
source§impl<T, C> AsyncWrite for StubbornIo<T, C>
impl<T, C> AsyncWrite for StubbornIo<T, C>
source§fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize>>
fn poll_write( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8] ) -> Poll<Result<usize>>
Attempt to write bytes from
buf
into the object. Read moresource§fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
Attempts to flush the object, ensuring that any buffered data reach
their destination. Read more
source§fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
Initiates or attempts to shut down this writer, returning success when
the I/O connection has completely shut down. Read more
source§fn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize>>
fn poll_write_vectored( self: Pin<&mut Self>, cx: &mut Context<'_>, bufs: &[IoSlice<'_>] ) -> Poll<Result<usize>>
Like
poll_write
, except that it writes from a slice of buffers. Read moresource§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
Determines if this writer has an efficient
poll_write_vectored
implementation. Read moresource§impl<T, C> Deref for StubbornIo<T, C>
impl<T, C> Deref for StubbornIo<T, C>
Auto Trait Implementations§
impl<T, C> Freeze for StubbornIo<T, C>
impl<T, C> !RefUnwindSafe for StubbornIo<T, C>
impl<T, C> Send for StubbornIo<T, C>
impl<T, C> Sync for StubbornIo<T, C>
impl<T, C> Unpin for StubbornIo<T, C>
impl<T, C> !UnwindSafe for StubbornIo<T, C>
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