[][src]Struct scalc::SCell

pub struct SCell<T> { /* fields omitted */ }

The structure which ensures the calculation safety

Methods

impl<T> SCell<T>[src]

pub fn new(data: T) -> Self[src]

Create a new SCell

pub fn is_overflowed(&self) -> bool[src]

Get the status which denotes that whether it's overflowed or not
true for overflowed and false for normal status

pub fn get_data(&self) -> &T[src]

Get the data of underlying type T

Trait Implementations

impl<T: Clone> Clone for SCell<T>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T: PartialOrd + Ord> Ord for SCell<T>[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl<T: PartialEq + Ord> PartialOrd<SCell<T>> for SCell<T>[src]

#[must_use] fn lt(&self, other: &Rhs) -> bool1.0.0[src]

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

#[must_use] fn le(&self, other: &Rhs) -> bool1.0.0[src]

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

#[must_use] fn gt(&self, other: &Rhs) -> bool1.0.0[src]

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

#[must_use] fn ge(&self, other: &Rhs) -> bool1.0.0[src]

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

impl<T: PartialEq> PartialEq<SCell<T>> for SCell<T>[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl<T: Copy> Copy for SCell<T>[src]

impl<T: PartialEq> Eq for SCell<T>[src]

impl<T: Debug> Debug for SCell<T>[src]

impl<T: One + CheckedDiv> Div<SCell<T>> for SCell<T>[src]

type Output = Self

The resulting type after applying the / operator.

impl<T: One + CheckedAdd> Add<SCell<T>> for SCell<T>[src]

type Output = Self

The resulting type after applying the + operator.

impl<T: One + CheckedSub> Sub<SCell<T>> for SCell<T>[src]

type Output = Self

The resulting type after applying the - operator.

impl<T: One + CheckedMul> Mul<SCell<T>> for SCell<T>[src]

type Output = Self

The resulting type after applying the * operator.

impl<T: One + CheckedRem> Rem<SCell<T>> for SCell<T>[src]

type Output = Self

The resulting type after applying the % operator.

impl<T: One + CheckedNeg> Neg for SCell<T>[src]

type Output = Self

The resulting type after applying the - operator.

impl<T: One + CheckedAdd> AddAssign<SCell<T>> for SCell<T>[src]

impl<T: One + CheckedSub> SubAssign<SCell<T>> for SCell<T>[src]

impl<T: One + CheckedMul> MulAssign<SCell<T>> for SCell<T>[src]

impl<T: One + CheckedDiv> DivAssign<SCell<T>> for SCell<T>[src]

impl<T: One + CheckedRem> RemAssign<SCell<T>> for SCell<T>[src]

impl<T: Num + CheckedAdd + CheckedSub + CheckedMul + CheckedDiv + CheckedRem> Num for SCell<T>[src]

type FromStrRadixErr = T::FromStrRadixErr

impl<T: Zero + One + CheckedAdd> Zero for SCell<T>[src]

fn set_zero(&mut self)[src]

Sets self to the additive identity element of Self, 0.

impl<T: One + CheckedMul + PartialEq> One for SCell<T>[src]

fn set_one(&mut self)[src]

Sets self to the multiplicative identity element of Self, 1.

impl<T: Signed + CheckedAdd + CheckedSub + CheckedMul + CheckedDiv + CheckedRem + CheckedNeg + Ord + Copy> Signed for SCell<T>[src]

Auto Trait Implementations

impl<T> Sync for SCell<T> where
    T: Sync

impl<T> Send for SCell<T> where
    T: Send

impl<T> Unpin for SCell<T> where
    T: Unpin

impl<T> RefUnwindSafe for SCell<T> where
    T: RefUnwindSafe

impl<T> UnwindSafe for SCell<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
    T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>, 
[src]

impl<T, Rhs> NumAssignOps<Rhs> for T where
    T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>, 
[src]

impl<T> NumAssign for T where
    T: Num + NumAssignOps<T>, 
[src]