Struct Correct

Source
pub struct Correct<T: Num>(pub T);

Tuple Fields§

§0: T

Implementations§

Source§

impl<T: Num> Correct<T>

Source

pub fn zero() -> Self

Source§

impl<T: SignedNum> Correct<T>

Source

pub fn abs(self) -> Self

Source

pub fn is_negative(self) -> bool

Source

pub fn is_positive(self) -> bool

Trait Implementations§

Source§

impl<T: Num> Add<T> for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: T) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: Num> Add for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: Num> AddAssign<T> for Correct<T>

Source§

fn add_assign(&mut self, rhs: T)

Performs the += operation. Read more
Source§

impl<T: Num> AddAssign for Correct<T>

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl<T: Num> BitAnd<T> for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: T) -> Self::Output

Performs the & operation. Read more
Source§

impl<T: Num> BitAnd for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Self) -> Self::Output

Performs the & operation. Read more
Source§

impl<T: Num> BitAndAssign<T> for Correct<T>

Source§

fn bitand_assign(&mut self, rhs: T)

Performs the &= operation. Read more
Source§

impl<T: Num> BitAndAssign for Correct<T>

Source§

fn bitand_assign(&mut self, rhs: Self)

Performs the &= operation. Read more
Source§

impl<T: Num> BitOr<T> for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: T) -> Self::Output

Performs the | operation. Read more
Source§

impl<T: Num> BitOr for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
Source§

impl<T: Num> BitOrAssign<T> for Correct<T>

Source§

fn bitor_assign(&mut self, rhs: T)

Performs the |= operation. Read more
Source§

impl<T: Num> BitOrAssign for Correct<T>

Source§

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
Source§

impl<T: Num> BitXor<T> for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: T) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<T: Num> BitXor for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Self) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<T: Num> BitXorAssign<T> for Correct<T>

Source§

fn bitxor_assign(&mut self, rhs: T)

Performs the ^= operation. Read more
Source§

impl<T: Num> BitXorAssign for Correct<T>

Source§

fn bitxor_assign(&mut self, rhs: Self)

Performs the ^= operation. Read more
Source§

impl<T: Clone + Num> Clone for Correct<T>

Source§

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

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: Num> Debug for Correct<T>

Source§

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

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

impl<T: Num> Display for Correct<T>

Source§

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

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

impl<T: Num> Div<T> for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: T) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: Num> Div for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: Num> DivAssign<T> for Correct<T>

Source§

fn div_assign(&mut self, rhs: T)

Performs the /= operation. Read more
Source§

impl<T: Num> DivAssign for Correct<T>

Source§

fn div_assign(&mut self, rhs: Self)

Performs the /= operation. Read more
Source§

impl<T: Num> From<T> for Correct<T>

Source§

fn from(v: T) -> Self

Converts to this type from the input type.
Source§

impl<T: Num> Mul<T> for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: T) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: Num> Mul for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: Num> MulAssign<T> for Correct<T>

Source§

fn mul_assign(&mut self, rhs: T)

Performs the *= operation. Read more
Source§

impl<T: Num> MulAssign for Correct<T>

Source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
Source§

impl<T: SignedNum> Neg for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<T: Num, R: PartialEq<T>> PartialEq<R> for Correct<T>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Num> Rem<T> for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: T) -> Self::Output

Performs the % operation. Read more
Source§

impl<T: Num> Rem for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Self) -> Self::Output

Performs the % operation. Read more
Source§

impl<T: Num> RemAssign<T> for Correct<T>

Source§

fn rem_assign(&mut self, rhs: T)

Performs the %= operation. Read more
Source§

impl<T: Num> RemAssign for Correct<T>

Source§

fn rem_assign(&mut self, rhs: Self)

Performs the %= operation. Read more
Source§

impl<T: Num> Shl<i128> for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i128) -> Self::Output

Performs the << operation. Read more
Source§

impl<T: Num> Shl<i32> for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i32) -> Self::Output

Performs the << operation. Read more
Source§

impl<T: Num> Shl<i64> for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i64) -> Self::Output

Performs the << operation. Read more
Source§

impl<T: Num> Shl<isize> for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: isize) -> Self::Output

Performs the << operation. Read more
Source§

impl<T: Num> Shl<u128> for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u128) -> Self::Output

Performs the << operation. Read more
Source§

impl<T: Num> Shl<u32> for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u32) -> Self::Output

Performs the << operation. Read more
Source§

impl<T: Num> Shl<u64> for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u64) -> Self::Output

Performs the << operation. Read more
Source§

impl<T: Num> Shl<usize> for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: usize) -> Self::Output

Performs the << operation. Read more
Source§

impl<T: Num> ShlAssign<i128> for Correct<T>

Source§

fn shl_assign(&mut self, rhs: i128)

Performs the <<= operation. Read more
Source§

impl<T: Num> ShlAssign<i32> for Correct<T>

Source§

fn shl_assign(&mut self, rhs: i32)

Performs the <<= operation. Read more
Source§

impl<T: Num> ShlAssign<i64> for Correct<T>

Source§

fn shl_assign(&mut self, rhs: i64)

Performs the <<= operation. Read more
Source§

impl<T: Num> ShlAssign<isize> for Correct<T>

Source§

fn shl_assign(&mut self, rhs: isize)

Performs the <<= operation. Read more
Source§

impl<T: Num> ShlAssign<u128> for Correct<T>

Source§

fn shl_assign(&mut self, rhs: u128)

Performs the <<= operation. Read more
Source§

impl<T: Num> ShlAssign<u32> for Correct<T>

Source§

fn shl_assign(&mut self, rhs: u32)

Performs the <<= operation. Read more
Source§

impl<T: Num> ShlAssign<u64> for Correct<T>

Source§

fn shl_assign(&mut self, rhs: u64)

Performs the <<= operation. Read more
Source§

impl<T: Num> ShlAssign<usize> for Correct<T>

Source§

fn shl_assign(&mut self, rhs: usize)

Performs the <<= operation. Read more
Source§

impl<T: Num> Shr<i128> for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i128) -> Self::Output

Performs the >> operation. Read more
Source§

impl<T: Num> Shr<i32> for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i32) -> Self::Output

Performs the >> operation. Read more
Source§

impl<T: Num> Shr<i64> for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i64) -> Self::Output

Performs the >> operation. Read more
Source§

impl<T: Num> Shr<isize> for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: isize) -> Self::Output

Performs the >> operation. Read more
Source§

impl<T: Num> Shr<u128> for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u128) -> Self::Output

Performs the >> operation. Read more
Source§

impl<T: Num> Shr<u32> for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u32) -> Self::Output

Performs the >> operation. Read more
Source§

impl<T: Num> Shr<u64> for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u64) -> Self::Output

Performs the >> operation. Read more
Source§

impl<T: Num> Shr<usize> for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: usize) -> Self::Output

Performs the >> operation. Read more
Source§

impl<T: Num> ShrAssign<i128> for Correct<T>

Source§

fn shr_assign(&mut self, rhs: i128)

Performs the >>= operation. Read more
Source§

impl<T: Num> ShrAssign<i32> for Correct<T>

Source§

fn shr_assign(&mut self, rhs: i32)

Performs the >>= operation. Read more
Source§

impl<T: Num> ShrAssign<i64> for Correct<T>

Source§

fn shr_assign(&mut self, rhs: i64)

Performs the >>= operation. Read more
Source§

impl<T: Num> ShrAssign<isize> for Correct<T>

Source§

fn shr_assign(&mut self, rhs: isize)

Performs the >>= operation. Read more
Source§

impl<T: Num> ShrAssign<u128> for Correct<T>

Source§

fn shr_assign(&mut self, rhs: u128)

Performs the >>= operation. Read more
Source§

impl<T: Num> ShrAssign<u32> for Correct<T>

Source§

fn shr_assign(&mut self, rhs: u32)

Performs the >>= operation. Read more
Source§

impl<T: Num> ShrAssign<u64> for Correct<T>

Source§

fn shr_assign(&mut self, rhs: u64)

Performs the >>= operation. Read more
Source§

impl<T: Num> ShrAssign<usize> for Correct<T>

Source§

fn shr_assign(&mut self, rhs: usize)

Performs the >>= operation. Read more
Source§

impl<T: Num> Sub<T> for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: T) -> Self::Output

Performs the - operation. Read more
Source§

impl<T: Num> Sub for Correct<T>

Source§

type Output = Correct<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl<T: Num> SubAssign<T> for Correct<T>

Source§

fn sub_assign(&mut self, rhs: T)

Performs the -= operation. Read more
Source§

impl<T: Num> SubAssign for Correct<T>

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl<T: Copy + Num> Copy for Correct<T>

Source§

impl<T: Eq + Num> Eq for Correct<T>

Source§

impl<T: Num> Send for Correct<T>

Source§

impl<T: Num> Sync for Correct<T>

Auto Trait Implementations§

§

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

§

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

§

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

§

impl<T> UnwindSafe for Correct<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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.