#[non_exhaustive]pub enum TargetSource {
Sync(Arc<dyn Fn(&Exchange) -> Option<String> + Send + Sync>),
Async(Arc<dyn Fn(&Exchange) -> BoxValueFuture + Send + Sync>),
}Expand description
Fallible target source for dynamic routers and routing slips.
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(Arc<dyn Fn(&Exchange) -> Option<String> + Send + Sync>)
Programmatic synchronous closure producing an optional target.
Async(Arc<dyn Fn(&Exchange) -> BoxValueFuture + Send + Sync>)
Language-backed asynchronous expression.
Implementations§
Source§impl TargetSource
impl TargetSource
Trait Implementations§
Source§impl Clone for TargetSource
impl Clone for TargetSource
Auto Trait Implementations§
impl !RefUnwindSafe for TargetSource
impl !UnwindSafe for TargetSource
impl Freeze for TargetSource
impl Send for TargetSource
impl Sync for TargetSource
impl Unpin for TargetSource
impl UnsafeUnpin for TargetSource
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