Struct inter_val::HalfBounded

source ·
pub struct HalfBounded<T, B, LR>(/* private fields */);

Implementations§

source§

impl<T, B, LR> HalfBounded<T, B, LR>

source

pub fn cast<U: From<T>>(self) -> HalfBounded<U, B, LR>

source§

impl<T: NumCast, B, LR> HalfBounded<T, B, LR>

source

pub fn try_cast<U: NumCast>(self) -> Option<HalfBounded<U, B, LR>>

source§

impl<T: PartialOrd, B: BoundaryOf<Left>> HalfBounded<T, B, Left>

source

pub fn includes(&self, other: &Self) -> bool

source

pub fn contains(&self, t: &T) -> bool

source

pub fn intersection<'a>(&'a self, other: &'a Self) -> &'a Self

source

pub fn union<'a>(&'a self, other: &'a Self) -> &'a Self

source

pub fn hull(self, t: T) -> Self

source

pub fn dilate(self, delta: T) -> Self
where T: Sub<Output = T>,

source

pub fn inf(&self) -> &T

source

pub fn closure(self) -> LeftBounded<T, Inclusive>

source

pub fn interior(self) -> LeftBounded<T, Exclusive>

source

pub fn ceil(&self) -> T
where Bound<T, B>: Ceil<T>,

use inter_val::{LeftBounded, Inclusive, Exclusive};
let a: LeftBounded<_, _> = Inclusive.at(4).into();
let b: LeftBounded<_, _> = Exclusive.at(4).into();
let c: LeftBounded<_, _> = Inclusive.at(1.23).into();
assert_eq!(a.ceil(), 4);
assert_eq!(b.ceil(), 5);
assert_eq!(c.ceil(), 2.0);
source§

impl<T: PartialOrd, B: BoundaryOf<Right>> HalfBounded<T, B, Right>

source

pub fn includes(&self, other: &Self) -> bool

source

pub fn contains(&self, t: &T) -> bool

source

pub fn intersection<'a>(&'a self, other: &'a Self) -> &'a Self

source

pub fn union<'a>(&'a self, other: &'a Self) -> &'a Self

source

pub fn hull(self, t: T) -> Self

source

pub fn dilate(self, delta: T) -> Self
where T: Add<Output = T>,

source

pub fn sup(&self) -> &T

source

pub fn closure(self) -> RightBounded<T, Inclusive>

source

pub fn floor(&self) -> T
where Bound<T, B>: Floor<T>,

use inter_val::{RightBounded, Inclusive, Exclusive};
let a : RightBounded<_, _> = Inclusive.at(7).into();
let b : RightBounded<_, _> = Exclusive.at(7).into();
let c : RightBounded<_, _> = Inclusive.at(4.56).into();
assert_eq!(a.floor(), 7);
assert_eq!(b.floor(), 6);
assert_eq!(c.floor(), 4.0);
source

pub fn interior(self) -> RightBounded<T, Exclusive>

Trait Implementations§

source§

impl<T: Clone, B: Clone, LR: Clone> Clone for HalfBounded<T, B, LR>

source§

fn clone(&self) -> HalfBounded<T, B, LR>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug, B: Debug, LR: Debug> Debug for HalfBounded<T, B, LR>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T, B, LR> Deref for HalfBounded<T, B, LR>

§

type Target = Bound<T, B>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<T, B, LR> DerefMut for HalfBounded<T, B, LR>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<T, B, LR> From<Bound<T, B>> for HalfBounded<T, B, LR>

source§

fn from(b: Bound<T, B>) -> Self

Converts to this type from the input type.
source§

impl<T: PartialEq, B: PartialEq, LR> PartialEq for HalfBounded<T, B, LR>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: PartialOrd, B: BoundaryOf<LR>, LR> PartialOrd for HalfBounded<T, B, LR>

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<T: Copy, B: Copy, LR: Copy> Copy for HalfBounded<T, B, LR>

source§

impl<T: Eq, B: Eq, LR> Eq for HalfBounded<T, B, LR>

Auto Trait Implementations§

§

impl<T, B, LR> RefUnwindSafe for HalfBounded<T, B, LR>

§

impl<T, B, LR> Send for HalfBounded<T, B, LR>
where B: Send, LR: Send, T: Send,

§

impl<T, B, LR> Sync for HalfBounded<T, B, LR>
where B: Sync, LR: Sync, T: Sync,

§

impl<T, B, LR> Unpin for HalfBounded<T, B, LR>
where B: Unpin, LR: Unpin, T: Unpin,

§

impl<T, B, LR> UnwindSafe for HalfBounded<T, B, LR>
where B: UnwindSafe, LR: UnwindSafe, T: UnwindSafe,

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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

§

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.