partial_function

Struct PartialFunctionBuilder

Source
pub struct PartialFunctionBuilder<B, O> { /* private fields */ }
Expand description

A builder to create an immutable PartialFunction.

Implementations§

Source§

impl<B, O> PartialFunctionBuilder<B, O>

Source

pub fn new() -> Self

Constructs a new PartialFunctionBuilder.

Source§

impl<B: PartialOrd, O> PartialFunctionBuilder<B, O>

Source

pub fn with(self, lower: B, higher: B, func: Box<dyn Fn(B) -> O>) -> Self

Adds a bounded function bounded between [lower,higher[ of function func.

Source

pub fn can_insert(&self, lower: &B, higher: &B) -> bool

Check if you can safely insert into the function list for the specified bounds.

Source

pub fn build(self) -> PartialFunction<B, O>

Builds the PartialFunction from the functions added using with.

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<B, O> !UnwindSafe for PartialFunctionBuilder<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.