Skip to main content

AsyncIo

Struct AsyncIo 

Source
pub struct AsyncIo<T: ?Sized> { /* private fields */ }
Expand description

Adapter from ZMux async stream traits to standard async I/O traits.

With the tokio-io feature this type implements tokio::io::AsyncRead and/or tokio::io::AsyncWrite. With the futures-io feature it implements futures_io::AsyncRead and/or futures_io::AsyncWrite.

Implementations§

Source§

impl<T> AsyncIo<T>
where T: Send + Sync + 'static,

Source

pub fn new(stream: T) -> Self

Wraps an owned async ZMux stream behind standard async I/O traits.

Source§

impl<T: ?Sized> AsyncIo<T>

Source

pub fn from_arc(inner: Arc<T>) -> Self

Wraps an already shared async ZMux stream.

Source

pub fn get_ref(&self) -> &T

Borrows the wrapped stream.

Source

pub fn as_arc(&self) -> &Arc<T>

Borrows the shared owner.

Source

pub fn into_inner(self) -> Arc<T>

Returns the shared owner of the wrapped stream.

Source

pub fn read_chunk_size(&self) -> usize

Returns the maximum read buffer used per poll operation.

Source

pub fn set_read_chunk_size(&mut self, size: usize)

Sets the maximum read buffer used per poll operation.

Source

pub fn write_chunk_size(&self) -> usize

Returns the maximum write buffer copied per poll operation.

Source

pub fn set_write_chunk_size(&mut self, size: usize)

Sets the maximum write buffer copied per poll operation.

Trait Implementations§

Source§

impl<T: ?Sized> Unpin for AsyncIo<T>

Auto Trait Implementations§

§

impl<T> Freeze for AsyncIo<T>
where T: ?Sized,

§

impl<T> RefUnwindSafe for AsyncIo<T>
where T: RefUnwindSafe + ?Sized,

§

impl<T> Send for AsyncIo<T>
where T: Sync + Send + ?Sized,

§

impl<T> Sync for AsyncIo<T>
where T: Sync + Send + ?Sized,

§

impl<T> UnsafeUnpin for AsyncIo<T>
where T: ?Sized,

§

impl<T> UnwindSafe for AsyncIo<T>
where T: RefUnwindSafe + ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.