Skip to main content

AnyIncDecCpCmp

Struct AnyIncDecCpCmp 

Source
pub struct AnyIncDecCpCmp<T>
where T: PartialOrd + Clone + Copy,
{ /* private fields */ }
Expand description

The Generic Implementation of IncDecCpCmp.

Acts as the general proxy layer for working with any type inside crate.

Note: unlike NumberIncDecCpCmp, the self.inc(a,b) and self.dec(a,b) are unchecked! If you are working with primitive numbers use: NumberIncDecCpCmp in stead.

Implementations§

Source§

impl<T> AnyIncDecCpCmp<T>
where T: PartialOrd + Clone + Copy,

Source

pub fn new(min: T, max: T) -> Self

Source

pub fn set_min(&mut self, v: T)

Sets the values returned by self.min() and self.min_ref(). Changing this value from the default will further constrain what ranges are considered invalid.

Source

pub fn set_max(&mut self, v: T)

Sets the values returned by self.max() and self.max_ref(). Changing this value from the default will further constrain what ranges are considered invalid.

Trait Implementations§

Source§

impl<T> Clone for AnyIncDecCpCmp<T>
where T: PartialOrd + Clone + Copy + Clone,

Source§

fn clone(&self) -> AnyIncDecCpCmp<T>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<T> Copy for AnyIncDecCpCmp<T>
where T: PartialOrd + Clone + Copy + Copy,

Source§

impl<T> CpCmp<T> for AnyIncDecCpCmp<T>
where T: PartialOrd + Copy,

Source§

fn cp(&self, v: &T) -> T

Returns a copy of v.

Source§

fn min_ref(&self) -> &T

Returns a ref to self.min.

Source§

fn max_ref(&self) -> &T

Returns a ref to self.max.

Source§

fn lt(&self, a: &T, b: &T) -> bool

Returns true if a lt b.

Source§

fn min(&self) -> T

Returns a copy of min.

Source§

fn max(&self) -> T

Returns a copy of max.

Source§

fn gt(&self, a: &T, b: &T) -> bool

Returns true if a gt b.
Source§

fn eq(&self, a: &T, b: &T) -> bool

Returns true if a eq b.
Source§

fn ne(&self, a: &T, b: &T) -> bool

Returns true if a ne b.
Source§

fn le(&self, a: &T, b: &T) -> bool

Returns true if a le b.
Source§

fn ge(&self, a: &T, b: &T) -> bool

Returns true if a ge b.
Source§

fn contains(&self, a: &T, b: &T, c: &T) -> bool

Returns true if a and b contain c.
Source§

fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)

Returns a new owned copy of the input ref tuple.
Source§

fn overlap(&self, a: &T, b: &T, c: &T, d: &T) -> bool

Returns true if any of the following are true Read more
Source§

fn is_invalid_set(&self, a: &T, b: &T) -> bool

Returns true if b lt a or a lt self.min_ref() or self.max_ref() lt b.
Source§

impl<T> Debug for AnyIncDecCpCmp<T>
where T: PartialOrd + Clone + Copy + Debug,

Source§

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

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

impl<T, V> IncDecCpCmp<T, V> for AnyIncDecCpCmp<T>
where V: Copy, T: PartialOrd + Copy + Add<V, Output = T> + Sub<V, Output = T>,

Source§

fn inc(&self, a: &T, b: &V) -> Option<T>

Increments a by b, if the resulting value is le a None is returned.

Source§

fn dec(&self, a: &T, b: &V) -> Option<T>

Increments a by b, if the resulting value is ge a None is returned.

Source§

fn cp_v(&self, v: &V) -> V

Source§

fn rebound_start(&self, start: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted start value. Read more
Source§

fn rebound_end(&self, end: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted end value. Read more

Auto Trait Implementations§

§

impl<T> Freeze for AnyIncDecCpCmp<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for AnyIncDecCpCmp<T>
where T: RefUnwindSafe,

§

impl<T> Send for AnyIncDecCpCmp<T>
where T: Send,

§

impl<T> Sync for AnyIncDecCpCmp<T>
where T: Sync,

§

impl<T> Unpin for AnyIncDecCpCmp<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for AnyIncDecCpCmp<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for AnyIncDecCpCmp<T>
where 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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

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.