pub struct WaitSet { /* private fields */ }Expand description
WaitSet — Spec §2.2.2.1.6.
A WaitSet collects 0..N Arc<dyn Condition> and blocks in
Self::wait until at least one triggers or a timeout is reached.
Returns the list of triggered conditions.
Implementations§
Source§impl WaitSet
impl WaitSet
Sourcepub fn attach_condition(&self, cond: Arc<dyn Condition>) -> Result<()>
pub fn attach_condition(&self, cond: Arc<dyn Condition>) -> Result<()>
Attaches a condition. Spec §2.2.2.1.6 attach_condition.
§Errors
PreconditionNotMet if the internal lock is poisoned.
Sourcepub fn detach_condition(&self, cond: &Arc<dyn Condition>) -> Result<()>
pub fn detach_condition(&self, cond: &Arc<dyn Condition>) -> Result<()>
Detaches a condition. Spec §2.2.2.1.6 detach_condition.
§Errors
PreconditionNotMet if the internal lock is poisoned.
Sourcepub fn wait(&self, timeout: Duration) -> Result<Vec<Arc<dyn Condition>>>
pub fn wait(&self, timeout: Duration) -> Result<Vec<Arc<dyn Condition>>>
Blocks until at least one condition triggers or the timeout
elapses. Returns the list of triggered conditions. Spec
§2.2.2.1.6 wait.
Implementation: polling at a 1ms interval. A production- grade WaitSet would offer conditions notify hooks; that is a follow-up optimization.
§Errors
DdsError::Timeoutif no condition triggers within the timeout.DdsError::PreconditionNotMeton lock poisoning.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WaitSet
impl RefUnwindSafe for WaitSet
impl Send for WaitSet
impl Sync for WaitSet
impl Unpin for WaitSet
impl UnsafeUnpin for WaitSet
impl UnwindSafe for WaitSet
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