partial_function

Struct LowerPartialFunction

Source
pub struct LowerPartialFunction<B, O>
where B: PartialOrd,
{ /* private fields */ }
Expand description

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§

Source§

impl<B, O> LowerPartialFunction<B, O>
where B: PartialOrd,

Source

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

Creates a new LowerPartialFunctionBuilder.

Source

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

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

Auto Trait Implementations§

§

impl<B, O> Freeze for LowerPartialFunction<B, O>

§

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§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.