pub struct AsyncTube {
    inner: IoSource<Tube>,
}

Fields§

§inner: IoSource<Tube>

Implementations§

source§

impl AsyncTube

source

pub fn new(ex: &Executor, tube: Tube) -> Result<AsyncTube>

source

pub async fn next<T: DeserializeOwned>(&self) -> TubeResult<T>

source

pub async fn send<T: 'static + Serialize + Send + Sync>( &self, msg: T ) -> TubeResult<()>

Methods from Deref<Target = Tube>§

pub fn try_clone_send_tube(&self) -> Result<SendTube, Error>

pub fn try_clone(&self) -> Result<Tube, Error>

👎Deprecated

DO NOT USE this method directly as it will become private soon (b/221484449). Use a directional Tube pair instead.

pub fn send<T>(&self, msg: &T) -> Result<(), Error>
where T: Serialize,

Sends a message via a Tube. The number of file descriptors that this method can send is limited to TUBE_MAX_FDS. If you want to send more descriptors, use send_with_max_fds instead.

pub fn send_with_max_fds<T>(&self, msg: &T, max_fds: usize) -> Result<(), Error>
where T: Serialize,

Sends a message with at most max_fds file descriptors via a Tube. Note that max_fds must not exceed SCM_SOCKET_MAX_FD_COUNT (= 253).

pub fn recv<T>(&self) -> Result<T, Error>

Recieves a message from a Tube. If the sender sent file descriptors more than TUBE_MAX_FDS with send_with_max_fds, use recv_with_max_fds instead.

pub fn recv_with_max_fds<T>(&self, max_fds: usize) -> Result<T, Error>

Recieves a message with at most max_fds file descriptors from a Tube.

pub fn set_send_timeout(&self, timeout: Option<Duration>) -> Result<(), Error>

pub fn set_recv_timeout(&self, timeout: Option<Duration>) -> Result<(), Error>

Trait Implementations§

source§

impl Deref for AsyncTube

§

type Target = Tube

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl From<AsyncTube> for Tube

source§

fn from(at: AsyncTube) -> Tube

Converts to this type from the input type.

Auto Trait Implementations§

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>,

§

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>,

§

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.