pub struct CurriedFn<D: Domain> { /* private fields */ }Expand description
Wraps a DSL function in a struct that manages currying of the arguments which are fed in one at a time through .apply(). Example: the “+” primitive evaluates to a CurriedFn with arity 2 and empty partial_args. The expression (app + 3) evals to a CurriedFn with vec![3] as the partial_args. The expression (app (app + 3) 4) will evaluate to 7 (since .apply() will fill the last argument, notice that all arguments are filled, and return the result).
Implementations§
Trait Implementations§
Source§impl<'de, D> Deserialize<'de> for CurriedFn<D>where
D: Deserialize<'de> + Domain,
impl<'de, D> Deserialize<'de> for CurriedFn<D>where
D: Deserialize<'de> + Domain,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<D: Eq + Domain> Eq for CurriedFn<D>
impl<D: Domain> StructuralPartialEq for CurriedFn<D>
Auto Trait Implementations§
impl<D> Freeze for CurriedFn<D>
impl<D> RefUnwindSafe for CurriedFn<D>where
D: RefUnwindSafe,
impl<D> Send for CurriedFn<D>where
D: Send,
impl<D> Sync for CurriedFn<D>where
D: Sync,
impl<D> Unpin for CurriedFn<D>where
D: Unpin,
impl<D> UnwindSafe for CurriedFn<D>where
D: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.