pub enum GreeksFilterCallback {
Function(fn(&GreeksData) -> bool),
Closure(Rc<dyn Fn(&GreeksData) -> bool>),
}Expand description
Cloneable wrapper for greeks filter functions.
Variants§
Function(fn(&GreeksData) -> bool)
Function pointer (non-capturing closure)
Closure(Rc<dyn Fn(&GreeksData) -> bool>)
Boxed closure (may capture variables)
Implementations§
Source§impl GreeksFilterCallback
impl GreeksFilterCallback
Sourcepub fn from_fn(f: fn(&GreeksData) -> bool) -> Self
pub fn from_fn(f: fn(&GreeksData) -> bool) -> Self
Create a new filter from a function pointer.
Sourcepub fn from_closure<F>(f: F) -> Self
pub fn from_closure<F>(f: F) -> Self
Create a new filter from a closure.
Sourcepub fn to_greeks_filter(self) -> GreeksFilter
pub fn to_greeks_filter(self) -> GreeksFilter
Convert to the original GreeksFilter type.
Trait Implementations§
Source§impl Clone for GreeksFilterCallback
impl Clone for GreeksFilterCallback
Source§fn clone(&self) -> GreeksFilterCallback
fn clone(&self) -> GreeksFilterCallback
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for GreeksFilterCallback
impl !Send for GreeksFilterCallback
impl !Sync for GreeksFilterCallback
impl !UnwindSafe for GreeksFilterCallback
impl Freeze for GreeksFilterCallback
impl Unpin for GreeksFilterCallback
impl UnsafeUnpin for GreeksFilterCallback
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