pub enum SortKeySource {
Sync(Arc<dyn Fn(&Value) -> Result<SortKey, CamelError> + Send + Sync>),
Async(Arc<dyn Fn(&Value) -> BoxValueFuture + Send + Sync>),
}Expand description
Extracts a sort key from each element of the body array.
The sync arm keeps the historical contract (the closure decides what is a valid key). The async arm rejects non-scalar results: Array/Object keys are a user error.
Variants§
Sync(Arc<dyn Fn(&Value) -> Result<SortKey, CamelError> + Send + Sync>)
Programmatic synchronous key extractor.
Async(Arc<dyn Fn(&Value) -> BoxValueFuture + Send + Sync>)
Language-backed asynchronous expression.
Implementations§
Source§impl SortKeySource
impl SortKeySource
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SortKeySource
impl !UnwindSafe for SortKeySource
impl Freeze for SortKeySource
impl Send for SortKeySource
impl Sync for SortKeySource
impl Unpin for SortKeySource
impl UnsafeUnpin for SortKeySource
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