[][src]Struct partial_function::LowerPartialFunction

pub struct LowerPartialFunction<B, O> where
    B: PartialOrd
{ /* fields omitted */ }

A lower partial function is a function that is defined by segments valid from [x..infinite[, or until it hits another function's start. It starts searching at -infinity and goes up to infinity, and takes the last seen function that contains the desired invariable value (x).

Example: [0..infinity[ = 5 [1..infinity[ = 10

f(0.5) = 5 f(1) = 10 f(70) = 10

Implementations

impl<B, O> LowerPartialFunction<B, O> where
    B: PartialOrd
[src]

pub fn new() -> LowerPartialFunctionBuilder<B, O>[src]

Creates a new LowerPartialFunctionBuilder.

pub fn eval(&self, x: B) -> Option<O>[src]

Evaluates the partial function. Returns None if no function is defined for the searched invariable value (x).

Auto Trait Implementations

impl<B, O> !RefUnwindSafe for LowerPartialFunction<B, O>

impl<B, O> !Send for LowerPartialFunction<B, O>

impl<B, O> !Sync for LowerPartialFunction<B, O>

impl<B, O> Unpin for LowerPartialFunction<B, O> where
    B: Unpin

impl<B, O> !UnwindSafe for LowerPartialFunction<B, O>

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, 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.