Struct cros_async::sys::linux::async_types::AsyncTube
source · pub struct AsyncTube {
inner: IoSource<Tube>,
}
Fields§
§inner: IoSource<Tube>
Implementations§
Methods from Deref<Target = Tube>§
pub fn try_clone_send_tube(&self) -> Result<SendTube, Error>
pub fn try_clone(&self) -> Result<Tube, Error>
👎Deprecated
pub fn try_clone(&self) -> Result<Tube, Error>
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,
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,
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>where
T: DeserializeOwned,
pub fn recv<T>(&self) -> Result<T, Error>where
T: DeserializeOwned,
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>where
T: DeserializeOwned,
pub fn recv_with_max_fds<T>(&self, max_fds: usize) -> Result<T, Error>where
T: DeserializeOwned,
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§
Auto Trait Implementations§
impl !RefUnwindSafe for AsyncTube
impl Send for AsyncTube
impl Sync for AsyncTube
impl Unpin for AsyncTube
impl !UnwindSafe for AsyncTube
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