pub struct Wait { /* private fields */ }Expand description
Describes when Dex may invoke a Step’s execute handler.
Build waits from durable timer and Channel Condition values. Combinators consume their
inputs and preserve order, which determines timer indexes used by crate::TimerId.
§Examples
use dex_sdk::{Channel, Timer, Wait};
use std::time::Duration;
let approvals = Channel::<String>::new("approvals");
let wait = Wait::any_of([
approvals.for_one().with_id("approved"),
Timer::by_duration(Duration::from_secs(300)).with_id("timeout"),
]);Implementations§
Source§impl Wait
impl Wait
Sourcepub fn skip_immediately() -> Self
pub fn skip_immediately() -> Self
Skips wait_for and asks Dex to invoke execute immediately.
Sourcepub fn all_of(conditions: impl IntoIterator<Item = Condition>) -> Self
pub fn all_of(conditions: impl IntoIterator<Item = Condition>) -> Self
Waits until every condition is satisfied.
Sourcepub fn any_of(conditions: impl IntoIterator<Item = Condition>) -> Self
pub fn any_of(conditions: impl IntoIterator<Item = Condition>) -> Self
Waits until at least one condition is satisfied.
Sourcepub fn any_combination_of(
combinations: impl IntoIterator<Item = ConditionCombination>,
) -> Self
pub fn any_combination_of( combinations: impl IntoIterator<Item = ConditionCombination>, ) -> Self
Waits for every Condition in any combination.
Every Condition needs a non-empty user ID. Clones of the same Condition may be reused across combinations; distinct Conditions need unique IDs.
Auto Trait Implementations§
impl !RefUnwindSafe for Wait
impl !UnwindSafe for Wait
impl Freeze for Wait
impl Send for Wait
impl Sync for Wait
impl Unpin for Wait
impl UnsafeUnpin for Wait
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request