[][src]Struct ddo::core::utils::Func

pub struct Func<F>(pub F);

A zero-cost abstraction adapter for function pointers. This is typically useful to pass a pointer to function/closure as an heuristic to use in the solver/mdd configuration.

Note that, it implements different heuristics trait depending on the signature of the wrapped function F.

Trait Implementations

impl<F: Clone> Clone for Func<F>[src]

impl<T, F> Compare<Node<T>, Node<T>> for Func<F> where
    F: Clone + Fn(&Node<T>, &Node<T>) -> Ordering
[src]

If the function is a node comparator, then Func will auto implement the Compare trait for that function.

impl<T, F> LoadVars<T> for Func<F> where
    F: Fn(&Node<T>) -> VarSet
[src]

If is able to extract a set of variables out of a reference to some node, then Func will auto implement the LoadVars trait for that function.

impl<T, F> VariableHeuristic<T> for Func<F> where
    F: Fn(&VarSet, Layer<T>, Layer<T>) -> Option<Variable>, 
[src]

Whenever the parameter function of Func is a function/closure that possibly returns a variable based on a set of free variables and two layers (current and next), then Func will auto implement the VariableHeuristic trait for that function.

impl<F> WidthHeuristic for Func<F> where
    F: Fn(&VarSet) -> usize
[src]

If the function determines a maximum width given a set of free vars, then Func will auto implement WidthHeuristic for that function.

Auto Trait Implementations

impl<F> RefUnwindSafe for Func<F> where
    F: RefUnwindSafe

impl<F> Send for Func<F> where
    F: Send

impl<F> Sync for Func<F> where
    F: Sync

impl<F> Unpin for Func<F> where
    F: Unpin

impl<F> UnwindSafe for Func<F> where
    F: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<F, L, R> Compare<L, R> for F where
    F: Fn(&L, &R) -> Ordering + ?Sized,
    L: ?Sized,
    R: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.