[][src]Struct yamakan::Obs

pub struct Obs<P, V = ()> {
    pub id: ObsId,
    pub param: P,
    pub value: V,
}

Observation.

Fields

id: ObsId

Observation identifier.

param: P

Evaluation parameter.

value: V

Observed value.

Methods

impl<P> Obs<P, ()>[src]

pub fn new<G: IdGen>(idg: G, param: P) -> Result<Self>[src]

Makes a new unevaluated observation.

impl<P, V> Obs<P, V>[src]

pub fn map_param<F, Q>(self, f: F) -> Obs<Q, V> where
    F: FnOnce(P) -> Q, 
[src]

Updates the parameter by the result of the given function.

pub fn try_map_param<F, Q, E>(self, f: F) -> Result<Obs<Q, V>, E> where
    F: FnOnce(P) -> Result<Q, E>, 
[src]

Tries updating the parameter by the result of the given function.

pub fn map_value<F, U>(self, f: F) -> Obs<P, U> where
    F: FnOnce(V) -> U, 
[src]

Updates the value by the result of the given function.

pub fn try_map_value<F, U, E>(self, f: F) -> Result<Obs<P, U>, E> where
    F: FnOnce(V) -> Result<U, E>, 
[src]

Tries updating the value by the result of the given function.

pub fn take_value(self) -> (Obs<P>, V)[src]

Takes the value of this observation.

Trait Implementations

impl<P: Clone, V: Clone> Clone for Obs<P, V>[src]

impl<P: Copy, V: Copy> Copy for Obs<P, V>[src]

impl<P: Debug, V: Debug> Debug for Obs<P, V>[src]

impl<P, V> From<MfObs<P, V>> for Obs<P, V>[src]

Auto Trait Implementations

impl<P, V> RefUnwindSafe for Obs<P, V> where
    P: RefUnwindSafe,
    V: RefUnwindSafe

impl<P, V> Send for Obs<P, V> where
    P: Send,
    V: Send

impl<P, V> Sync for Obs<P, V> where
    P: Sync,
    V: Sync

impl<P, V> Unpin for Obs<P, V> where
    P: Unpin,
    V: Unpin

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,