pub struct RawReceiverRegistration<T: ?Sized> { /* private fields */ }
Expand description
A registration of a PacketReceiver
.
When dropped, it will automatically deregister the PacketReceiver
.
Implementations§
Source§impl<T: ?Sized> RawReceiverRegistration<T>
impl<T: ?Sized> RawReceiverRegistration<T>
Sourcepub fn new(receiver: T) -> Selfwhere
T: Sized,
pub fn new(receiver: T) -> Selfwhere
T: Sized,
Returns a new ReceiverRegistration
wrapping the given PacketReceiver
.
Sourcepub fn is_registered(&self) -> bool
pub fn is_registered(&self) -> bool
Returns true
if the receiver registration has been registered with an executor.
Sourcepub fn register(self: Pin<&mut Self>, ehandle: EHandle)where
T: PacketReceiver + Sized,
pub fn register(self: Pin<&mut Self>, ehandle: EHandle)where
T: PacketReceiver + Sized,
Registers the registration with an executor.
Sourcepub fn unregister(self: Pin<&mut Self>) -> Option<(EHandle, u64)>
pub fn unregister(self: Pin<&mut Self>) -> Option<(EHandle, u64)>
Unregisters the registration from the executor.
If the registration was registered, the executor handle and key of the
previous registration are returned. Otherwise, returns None
.
Sourcepub fn key(&self) -> Option<u64>
pub fn key(&self) -> Option<u64>
The key with which Packet
s destined for this receiver should be sent on the zx::Port
.
Returns None
if this registration has not been registered yet.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for RawReceiverRegistration<T>
impl<T> !RefUnwindSafe for RawReceiverRegistration<T>
impl<T> Send for RawReceiverRegistration<T>
impl<T> Sync for RawReceiverRegistration<T>
impl<T> !UnwindSafe for RawReceiverRegistration<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