#[non_exhaustive]pub enum PredicateSource {
Sync(FilterPredicate),
Async(Arc<dyn Fn(&Exchange) -> BoxBoolFuture + Send + Sync>),
}Expand description
Fallible predicate source: either a synchronous FilterPredicate or an
asynchronous, fallible language predicate.
The sync arm always succeeds (Ok(bool)); the async arm may fail with a
CamelError that callers must propagate instead of silently treating the
exchange as skipped.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Sync(FilterPredicate)
Programmatic synchronous predicate.
Async(Arc<dyn Fn(&Exchange) -> BoxBoolFuture + Send + Sync>)
Language-backed asynchronous predicate.
Implementations§
Trait Implementations§
Source§impl Clone for PredicateSource
impl Clone for PredicateSource
Source§impl From<FilterPredicate> for PredicateSource
impl From<FilterPredicate> for PredicateSource
Source§fn from(pred: FilterPredicate) -> Self
fn from(pred: FilterPredicate) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for PredicateSource
impl !UnwindSafe for PredicateSource
impl Freeze for PredicateSource
impl Send for PredicateSource
impl Sync for PredicateSource
impl Unpin for PredicateSource
impl UnsafeUnpin for PredicateSource
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