pub struct ConditionSet { /* private fields */ }Expand description
What one gate waits on: or-groups that must all be satisfied.
Never built literally — a Condition, an OrGroup, or a collection
of either converts into one, and ConditionSet::and adds to it.
use std::time::Duration;
use hatchet_client::{Condition, ConditionSet, TaskBuilder, any_of};
// "after the sleep, and once either event has arrived"
let gate = ConditionSet::from(Condition::sleep(Duration::from_secs(30))).and(any_of([
Condition::on_event("ready"),
Condition::on_event("forced"),
]));
let publish = TaskBuilder::<(), ()>::new("publish")
.wait_for(gate)
.handler(|_ctx, _input| async { Ok(()) });Implementations§
Source§impl ConditionSet
impl ConditionSet
Sourcepub fn and(self, more: impl Into<ConditionSet>) -> Self
pub fn and(self, more: impl Into<ConditionSet>) -> Self
Adds another condition or group that must also be satisfied.
Trait Implementations§
Source§impl Clone for ConditionSet
impl Clone for ConditionSet
Source§impl Debug for ConditionSet
impl Debug for ConditionSet
Source§impl Default for ConditionSet
impl Default for ConditionSet
impl Eq for ConditionSet
Source§impl From<Condition> for ConditionSet
impl From<Condition> for ConditionSet
Source§impl From<OrGroup> for ConditionSet
impl From<OrGroup> for ConditionSet
Source§impl PartialEq for ConditionSet
impl PartialEq for ConditionSet
impl StructuralPartialEq for ConditionSet
Auto Trait Implementations§
impl Forget for ConditionSet
impl Freeze for ConditionSet
impl Move for ConditionSet
impl RefUnwindSafe for ConditionSet
impl Send for ConditionSet
impl Sync for ConditionSet
impl Unpin for ConditionSet
impl UnsafeUnpin for ConditionSet
impl UnwindSafe for ConditionSet
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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