pub struct SignalReceiver<T> { /* private fields */ }Expand description
Synchronous receiver for an OBS signal subscription.
Each subscriber has a bounded queue. If it falls behind, new callback events are dropped for that subscriber rather than blocking the OBS callback thread.
Implementations§
Source§impl<T> SignalReceiver<T>
impl<T> SignalReceiver<T>
pub fn recv(&self) -> Result<T, RecvError>
Sourcepub fn blocking_recv(&self) -> Result<T, RecvError>
pub fn blocking_recv(&self) -> Result<T, RecvError>
Compatibility alias for the old Tokio broadcast receiver call sites.
Sourcepub fn recv_timeout(&self, timeout: Duration) -> Result<T, RecvTimeoutError>
pub fn recv_timeout(&self, timeout: Duration) -> Result<T, RecvTimeoutError>
Waits for a signal for at most timeout.
Native OBS callbacks are not cancelled when this deadline expires. Callers that use a signal as completion for a native operation must therefore treat a timeout as an unknown completion state and re-query native state before retrying or tearing resources down.
pub fn try_recv(&self) -> Result<T, TryRecvError>
Trait Implementations§
Auto Trait Implementations§
impl<T> Forget for SignalReceiver<T>
impl<T> Freeze for SignalReceiver<T>
impl<T> Move for SignalReceiver<T>
impl<T> RefUnwindSafe for SignalReceiver<T>where
Receiver<T>: RefUnwindSafe,
impl<T> Send for SignalReceiver<T>where
Receiver<T>: Send,
impl<T> Sync for SignalReceiver<T>where
Receiver<T>: Sync,
impl<T> Unpin for SignalReceiver<T>
impl<T> UnsafeUnpin for SignalReceiver<T>where
*mut Counter<Channel<T>>: UnsafeUnpin,
*mut Counter<Channel<T>>: UnsafeUnpin,
*mut Counter<Channel<T>>: UnsafeUnpin,
*const ArcInner<Channel> is !null: UnsafeUnpin,
PhantomData<ArcInner<Channel>>: UnsafeUnpin,
*const ArcInner<Channel> is !null: UnsafeUnpin,
PhantomData<ArcInner<Channel>>: UnsafeUnpin,
PhantomData<T>: UnsafeUnpin,
impl<T> UnwindSafe for SignalReceiver<T>where
Receiver<T>: UnwindSafe,
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