[−][src]Struct scalc::SCell
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(&self) -> 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 cmp(&self, other: &Self) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl<T: PartialEq + Ord> PartialOrd<SCell<T>> for SCell<T>
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.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) -> bool
1.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) -> bool
1.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) -> bool
1.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]
fn eq(&self, other: &Self) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.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.
fn div(self, rhs: Self) -> Self::Output
[src]
impl<T: One + CheckedAdd> Add<SCell<T>> for SCell<T>
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self::Output
[src]
impl<T: One + CheckedSub> Sub<SCell<T>> for SCell<T>
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> Self::Output
[src]
impl<T: One + CheckedMul> Mul<SCell<T>> for SCell<T>
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: Self) -> Self::Output
[src]
impl<T: One + CheckedRem> Rem<SCell<T>> for SCell<T>
[src]
type Output = Self
The resulting type after applying the %
operator.
fn rem(self, rhs: Self) -> Self::Output
[src]
impl<T: One + CheckedNeg> Neg for SCell<T>
[src]
type Output = Self
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
impl<T: One + CheckedAdd> AddAssign<SCell<T>> for SCell<T>
[src]
fn add_assign(&mut self, rhs: Self)
[src]
impl<T: One + CheckedSub> SubAssign<SCell<T>> for SCell<T>
[src]
fn sub_assign(&mut self, rhs: Self)
[src]
impl<T: One + CheckedMul> MulAssign<SCell<T>> for SCell<T>
[src]
fn mul_assign(&mut self, rhs: Self)
[src]
impl<T: One + CheckedDiv> DivAssign<SCell<T>> for SCell<T>
[src]
fn div_assign(&mut self, rhs: Self)
[src]
impl<T: One + CheckedRem> RemAssign<SCell<T>> for SCell<T>
[src]
fn rem_assign(&mut self, rhs: Self)
[src]
impl<T: Num + CheckedAdd + CheckedSub + CheckedMul + CheckedDiv + CheckedRem> Num for SCell<T>
[src]
type FromStrRadixErr = T::FromStrRadixErr
fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>
[src]
impl<T: Zero + One + CheckedAdd> Zero for SCell<T>
[src]
fn zero() -> Self
[src]
fn is_zero(&self) -> bool
[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 one() -> Self
[src]
fn is_one(&self) -> bool
[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,
T: Sync,
impl<T> Send for SCell<T> where
T: Send,
T: Send,
impl<T> Unpin for SCell<T> where
T: Unpin,
T: Unpin,
impl<T> RefUnwindSafe for SCell<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> UnwindSafe for SCell<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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]
T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,
impl<T, Rhs> NumAssignOps<Rhs> for T where
T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,
[src]
T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,
impl<T> NumAssign for T where
T: Num + NumAssignOps<T>,
[src]
T: Num + NumAssignOps<T>,