[−][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 get_data(&self) -> &T
[src]
Get the data of underlying type T
impl<T: Zero> SCell<T>
[src]
pub fn zero() -> Self
[src]
See num
crate for more information
pub fn is_zero(&self) -> bool
[src]
See num
crate for more information
impl<T: One + PartialEq> SCell<T>
[src]
pub fn one() -> Self
[src]
See num
crate for more information
pub fn is_one(&self) -> bool
[src]
See num
crate for more information
impl<T: Num + CheckedAdd + CheckedSub + CheckedMul + CheckedDiv + CheckedRem> SCell<T>
[src]
pub fn from_str_radix(str: &str, radix: u32) -> Result<Self, T::FromStrRadixErr>
[src]
See num
crate for more information
impl<T: Signed + CheckedAdd + CheckedSub + CheckedMul + CheckedDiv + CheckedRem + CheckedNeg + Ord + Copy> SCell<T>
[src]
pub fn abs(&self) -> Option<Self>
[src]
See num
crate for more information
pub fn abs_sub(&self, other: &Self) -> Option<Self>
[src]
See num
crate for more information
pub fn signum(&self) -> Self
[src]
See num
crate for more information
pub fn is_positive(&self) -> bool
[src]
See num
crate for more information
pub fn is_negative(&self) -> bool
[src]
See num
crate for more information
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> PartialOrd<SCell<T>> for SCell<T>
[src]
fn partial_cmp(&self, other: &SCell<T>) -> Option<Ordering>
[src]
fn lt(&self, other: &SCell<T>) -> bool
[src]
fn le(&self, other: &SCell<T>) -> bool
[src]
fn gt(&self, other: &SCell<T>) -> bool
[src]
fn ge(&self, other: &SCell<T>) -> bool
[src]
impl<T: PartialEq> PartialEq<SCell<T>> for SCell<T>
[src]
impl<T: Copy> Copy for SCell<T>
[src]
impl<T: Debug> Debug for SCell<T>
[src]
impl<T: CheckedDiv> Div<SCell<T>> for SCell<T>
[src]
type Output = Option<Self>
The resulting type after applying the /
operator.
fn div(self, rhs: Self) -> Self::Output
[src]
impl<T: CheckedAdd> Add<SCell<T>> for SCell<T>
[src]
type Output = Option<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self::Output
[src]
impl<T: CheckedSub> Sub<SCell<T>> for SCell<T>
[src]
type Output = Option<Self>
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> Self::Output
[src]
impl<T: CheckedMul> Mul<SCell<T>> for SCell<T>
[src]
type Output = Option<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: Self) -> Self::Output
[src]
impl<T: CheckedRem> Rem<SCell<T>> for SCell<T>
[src]
type Output = Option<Self>
The resulting type after applying the %
operator.
fn rem(self, rhs: Self) -> Self::Output
[src]
impl<T: CheckedNeg> Neg for SCell<T>
[src]
type Output = Option<Self>
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
impl<T: Not> Not for SCell<T>
[src]
type Output = SCell<T::Output>
The resulting type after applying the !
operator.
fn not(self) -> Self::Output
[src]
impl<T: FromStr> FromStr 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>,