[−][src]Struct stubborn_io::tokio::StubbornIo
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.
Methods
impl<T, C> StubbornIo<T, C> where
T: UnderlyingIo<C>,
C: Clone + Send + Unpin + 'static,
[src]
T: UnderlyingIo<C>,
C: Clone + Send + Unpin + 'static,
pub async fn connect(ctor_arg: impl Borrow<C>) -> Result<Self>
[src]
Connects or creates a handle to the UnderlyingIo item, using the default reconnect options.
pub async fn connect_with_options(
ctor_arg: impl Borrow<C>,
options: ReconnectOptions
) -> Result<Self>
[src]
ctor_arg: impl Borrow<C>,
options: ReconnectOptions
) -> Result<Self>
Trait Implementations
impl<T, C> Deref for StubbornIo<T, C>
[src]
impl<T, C> DerefMut for StubbornIo<T, C>
[src]
impl<T, C> AsyncRead for StubbornIo<T, C> where
T: UnderlyingIo<C> + AsyncRead,
C: Clone + Send + Unpin + 'static,
[src]
T: UnderlyingIo<C> + AsyncRead,
C: Clone + Send + Unpin + 'static,
unsafe fn prepare_uninitialized_buffer(&self, buf: &mut [u8]) -> bool
[src]
fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize>>
fn poll_read_buf<B: BufMut>(
self: Pin<&mut Self>,
cx: &mut Context,
buf: &mut B
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
buf: &mut B
) -> Poll<Result<usize>>
impl<T, C> AsyncWrite for StubbornIo<T, C> where
T: UnderlyingIo<C> + AsyncWrite,
C: Clone + Send + Unpin + 'static,
[src]
T: UnderlyingIo<C> + AsyncWrite,
C: Clone + Send + Unpin + 'static,
fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context,
buf: &[u8]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
buf: &[u8]
) -> Poll<Result<usize>>
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Result<()>>
[src]
fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Result<()>>
[src]
fn poll_write_buf<B: Buf>(
self: Pin<&mut Self>,
cx: &mut Context,
buf: &mut B
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
buf: &mut B
) -> Poll<Result<usize>>
Auto Trait Implementations
impl<T, C> Unpin for StubbornIo<T, C> where
C: Unpin,
T: Unpin,
C: Unpin,
T: Unpin,
impl<T, C> !Sync for StubbornIo<T, C>
impl<T, C> Send for StubbornIo<T, C> where
C: Send,
T: Send,
C: Send,
T: Send,
impl<T, C> !UnwindSafe for StubbornIo<T, C>
impl<T, C> !RefUnwindSafe for StubbornIo<T, C>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<R> AsyncReadExt for R where
R: AsyncRead + ?Sized,
[src]
R: AsyncRead + ?Sized,
fn chain<R>(self, next: R) -> Chain<Self, R> where
R: AsyncRead,
[src]
R: AsyncRead,
Creates an adaptor which will chain this stream with another. Read more
fn copy<W>(&'a mut self, dst: &'a mut W) -> Copy<'a, Self, W> where
Self: Unpin,
W: AsyncWrite + Unpin + ?Sized,
[src]
Self: Unpin,
W: AsyncWrite + Unpin + ?Sized,
Copy all data from self
into the provided AsyncWrite
. Read more
fn read(&'a mut self, dst: &'a mut [u8]) -> Read<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
Read data into the provided buffer. Read more
fn read_exact(&'a mut self, dst: &'a mut [u8]) -> ReadExact<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
Read exactly the amount of data needed to fill the provided buffer.
fn read_to_end(&'a mut self, dst: &'a mut Vec<u8>) -> ReadToEnd<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
Read all bytes until EOF in this source, placing them into dst
. Read more
fn read_to_string(&'a mut self, dst: &'a mut String) -> ReadToString<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
Read all bytes until EOF in this source, placing them into dst
. Read more
fn take(self, limit: u64) -> Take<Self>
[src]
Creates an AsyncRead adapter which will read at most limit
bytes from the underlying reader. Read more
impl<W> AsyncWriteExt for W where
W: AsyncWrite + ?Sized,
[src]
W: AsyncWrite + ?Sized,
fn write(&'a mut self, src: &'a [u8]) -> Write<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
Write a buffer into this writter, returning how many bytes were written.
fn write_all(&'a mut self, src: &'a [u8]) -> WriteAll<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
Attempt to write an entire buffer into this writter.
fn flush(&mut self) -> Flush<Self> where
Self: Unpin,
[src]
Self: Unpin,
Flush the contents of this writer.
fn shutdown(&mut self) -> Shutdown<Self> where
Self: Unpin,
[src]
Self: Unpin,
Shutdown this writer.
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,