pub struct CallbackConditions {
pub only: Option<Vec<String>>,
pub except: Option<Vec<String>>,
pub if_cond: Option<ConditionPredicate>,
pub unless_cond: Option<ConditionPredicate>,
}Expand description
Conditions that control when a callback is eligible to run.
Fields§
§only: Option<Vec<String>>Optional allow-list of action names. When present, only listed actions match.
except: Option<Vec<String>>Optional deny-list of action names. When present, listed actions do not match.
if_cond: Option<ConditionPredicate>Predicate that must return true for the callback to run.
unless_cond: Option<ConditionPredicate>Predicate that must return false for the callback to run.
Implementations§
Source§impl CallbackConditions
impl CallbackConditions
Sourcepub fn only<I, S>(self, actions: I) -> Self
pub fn only<I, S>(self, actions: I) -> Self
Restricts the callback to the provided action names.
Sourcepub fn except<I, S>(self, actions: I) -> Self
pub fn except<I, S>(self, actions: I) -> Self
Prevents the callback from running for the provided action names.
Trait Implementations§
Source§impl Debug for CallbackConditions
impl Debug for CallbackConditions
Source§impl Default for CallbackConditions
impl Default for CallbackConditions
Source§fn default() -> CallbackConditions
fn default() -> CallbackConditions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CallbackConditions
impl !RefUnwindSafe for CallbackConditions
impl Send for CallbackConditions
impl Sync for CallbackConditions
impl Unpin for CallbackConditions
impl UnsafeUnpin for CallbackConditions
impl !UnwindSafe for CallbackConditions
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more