[][src]Struct ddo::core::implementation::mdd::builder::PbRef

pub struct PbRef<X, P> { /* fields omitted */ }

This structure provides typesafewrapper to turn a reference (a borrow) to some problem into something that actually implements the Problem trait.

Such a pbref may be created directly with a call to new But these instances are typically built using a call to mdd_builder_ref.

Example

let problem = MockProblem;
let relax   = MockRelax;
// This call creates an mdd configured with a configuration object that
// holds a copy of PbRef to the actual problem object.
let mdd     = mdd_builder_ref(&problem, relax)
                 .with_max_width(FixedWidth(100))
                 .build();
// thus, the problem can still be used here.
assert_eq!(0, problem.nb_vars());

Methods

impl<X, P> PbRef<X, P>[src]

pub fn new(x: X) -> Self[src]

This creates a new problem wrapper for the given reference.

Trait Implementations

impl<X: Clone, P: Clone> Clone for PbRef<X, P>[src]

impl<T, P, X> Problem<T> for PbRef<X, P> where
    P: Problem<T>,
    X: Borrow<P>, 
[src]

Auto Trait Implementations

impl<X, P> RefUnwindSafe for PbRef<X, P> where
    P: RefUnwindSafe,
    X: RefUnwindSafe

impl<X, P> Send for PbRef<X, P> where
    P: Send,
    X: Send

impl<X, P> Sync for PbRef<X, P> where
    P: Sync,
    X: Sync

impl<X, P> Unpin for PbRef<X, P> where
    P: Unpin,
    X: Unpin

impl<X, P> UnwindSafe for PbRef<X, P> where
    P: UnwindSafe,
    X: 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<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.