pub struct Channel<T: ?Sized + 'static>(/* private fields */);
Expand description
Implements a message channel through the Fuchsia Driver Runtime
Implementations§
Source§impl<T: ?Sized + 'static> Channel<T>
impl<T: ?Sized + 'static> Channel<T>
Sourcepub fn create() -> (Self, Self)
pub fn create() -> (Self, Self)
Creates a new channel pair that can be used to send messages of type T
between threads managed by the driver runtime.
Sourcepub fn driver_handle(&self) -> &DriverHandle
pub fn driver_handle(&self) -> &DriverHandle
Returns a reference to the inner handle of the channel.
Sourcepub fn into_driver_handle(self) -> DriverHandle
pub fn into_driver_handle(self) -> DriverHandle
Takes the inner handle to the channel. The caller is responsible for ensuring that the handle is freed.
Sourcepub unsafe fn from_driver_handle(handle: DriverHandle) -> Self
pub unsafe fn from_driver_handle(handle: DriverHandle) -> Self
Sourcepub fn write(&self, message: Message<T>) -> Result<(), Status>
pub fn write(&self, message: Message<T>) -> Result<(), Status>
Writes the Message
given to the channel. This will complete asynchronously and can’t
be cancelled.
The channel will take ownership of the data and handles passed in,
Sourcepub fn write_with<F>(&self, arena: Arena, f: F) -> Result<(), Status>
pub fn write_with<F>(&self, arena: Arena, f: F) -> Result<(), Status>
Shorthand for calling Self::write
with the result of Message::new_with
Sourcepub fn write_with_data<F>(&self, arena: Arena, f: F) -> Result<(), Status>
pub fn write_with_data<F>(&self, arena: Arena, f: F) -> Result<(), Status>
Shorthand for calling Self::write
with the result of Message::new_with
Source§impl<T> Channel<T>
impl<T> Channel<T>
Trait Implementations§
Source§impl<T: Ord + ?Sized + 'static> Ord for Channel<T>
impl<T: Ord + ?Sized + 'static> Ord for Channel<T>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialOrd + ?Sized + 'static> PartialOrd for Channel<T>
impl<T: PartialOrd + ?Sized + 'static> PartialOrd for Channel<T>
impl<T: Eq + ?Sized + 'static> Eq for Channel<T>
impl<T: ?Sized + 'static> StructuralPartialEq for Channel<T>
Auto Trait Implementations§
impl<T> Freeze for Channel<T>where
T: ?Sized,
impl<T> RefUnwindSafe for Channel<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Send for Channel<T>
impl<T> Sync for Channel<T>
impl<T> Unpin for Channel<T>
impl<T> UnwindSafe for Channel<T>
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