[−]Struct lv2rs::prelude::u14
The 14-bit unsigned integer type.
Methods
impl u14
impl u14
pub fn min_value() -> u14
Returns the smallest value that can be represented by this integer type.
pub fn max_value() -> u14
Returns the largest value that can be represented by this integer type.
pub fn new(value: u16) -> u14
Crates a new variable
This function mainly exists as there is currently not a better way to construct these types. May be deprecated or removed if a better way to construct these types becomes available.
Examples
Basic usage:
use ux::*; assert_eq!(u31::new(64), u31::from(64u8));
Panic
This function will panic if value
is not representable by this type
pub fn wrapping_sub(self, rhs: u14) -> u14
Wrapping (modular) subtraction. Computes self - other
,
wrapping around at the boundary of the type.
Examples
Basic usage:
use ux::*; assert_eq!(i5::MIN.wrapping_sub(i5::new(1)), i5::MAX); assert_eq!(i5::new(-10).wrapping_sub(i5::new(5)), i5::new(-15)); assert_eq!(i5::new(-15).wrapping_sub(i5::new(5)), i5::new(12));
pub fn wrapping_add(self, rhs: u14) -> u14
Wrapping (modular) addition. Computes self + other
,
wrapping around at the boundary of the type.
Examples
Basic usage:
use ux::*; assert_eq!(i5::MAX.wrapping_add(i5::new(1)), i5::MIN); assert_eq!(i5::new(10).wrapping_add(i5::new(5)), i5::new(15)); assert_eq!(i5::new(15).wrapping_add(i5::new(5)), i5::new(-12));
Trait Implementations
impl<T> ShlAssign<T> for u14 where
u16: ShlAssign<T>,
u16: ShlAssign<T>,
fn shl_assign(&mut self, rhs: T)
impl Octal for u14
impl<T> Shl<T> for u14 where
u16: Shl<T>,
<u16 as Shl<T>>::Output == u16,
u16: Shl<T>,
<u16 as Shl<T>>::Output == u16,
impl BitXorAssign<u14> for u14
fn bitxor_assign(&mut self, other: u14)
impl<'a> Not for &'a u14
type Output = <u14 as Not>::Output
The resulting type after applying the !
operator.
fn not(self) -> u14
impl Not for u14
impl UpperHex for u14
impl Copy for u14
impl LowerHex for u14
impl Ord for u14
fn cmp(&self, other: &u14) -> Ordering
default fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
default fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
default fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl<T> ShrAssign<T> for u14 where
u16: ShrAssign<T>,
u16: ShrAssign<T>,
fn shr_assign(&mut self, rhs: T)
impl BitAnd<u14> for u14
type Output = u14
The resulting type after applying the &
operator.
fn bitand(self, rhs: u14) -> <u14 as BitAnd<u14>>::Output
impl<'a> BitAnd<&'a u14> for &'a u14
type Output = <u14 as BitOr<u14>>::Output
The resulting type after applying the &
operator.
fn bitand(self, rhs: &'a u14) -> <&'a u14 as BitAnd<&'a u14>>::Output
impl<'a> BitAnd<&'a u14> for u14
type Output = <u14 as BitOr<u14>>::Output
The resulting type after applying the &
operator.
fn bitand(self, rhs: &'a u14) -> <u14 as BitAnd<&'a u14>>::Output
impl<'a> BitAnd<u14> for &'a u14
type Output = <u14 as BitOr<u14>>::Output
The resulting type after applying the &
operator.
fn bitand(self, rhs: u14) -> <&'a u14 as BitAnd<u14>>::Output
impl Add<u14> for u14
impl Clone for u14
fn clone(&self) -> u14
default fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl BitOrAssign<u14> for u14
fn bitor_assign(&mut self, other: u14)
impl BitAndAssign<u14> for u14
fn bitand_assign(&mut self, other: u14)
impl Hash for u14
fn hash<H>(&self, h: &mut H) where
H: Hasher,
H: Hasher,
default fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Eq for u14
impl<'a> BitOr<&'a u14> for &'a u14
type Output = <u14 as BitOr<u14>>::Output
The resulting type after applying the |
operator.
fn bitor(self, rhs: &'a u14) -> <&'a u14 as BitOr<&'a u14>>::Output
impl<'a> BitOr<u14> for &'a u14
type Output = <u14 as BitOr<u14>>::Output
The resulting type after applying the |
operator.
fn bitor(self, rhs: u14) -> <&'a u14 as BitOr<u14>>::Output
impl<'a> BitOr<&'a u14> for u14
type Output = <u14 as BitOr<u14>>::Output
The resulting type after applying the |
operator.
fn bitor(self, rhs: &'a u14) -> <u14 as BitOr<&'a u14>>::Output
impl BitOr<u14> for u14
type Output = u14
The resulting type after applying the |
operator.
fn bitor(self, rhs: u14) -> <u14 as BitOr<u14>>::Output
impl Sub<u14> for u14
impl PartialOrd<u14> for u14
fn partial_cmp(&self, other: &u14) -> Option<Ordering>
#[must_use]
default 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]
default 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]
default 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]
default 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 From<u6> for u14
impl From<u9> for u14
impl From<u2> for u14
impl From<u8> for u14
impl From<u10> for u14
impl From<u5> for u14
impl From<u3> for u14
impl From<u4> for u14
impl From<u13> for u14
impl From<u7> for u14
impl From<u11> for u14
impl From<u12> for u14
impl Display for u14
impl Debug for u14
impl<'a> BitXor<&'a u14> for u14
type Output = <u14 as BitOr<u14>>::Output
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: &'a u14) -> <u14 as BitXor<&'a u14>>::Output
impl<'a> BitXor<&'a u14> for &'a u14
type Output = <u14 as BitOr<u14>>::Output
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: &'a u14) -> <&'a u14 as BitXor<&'a u14>>::Output
impl BitXor<u14> for u14
type Output = u14
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: u14) -> <u14 as BitXor<u14>>::Output
impl<'a> BitXor<u14> for &'a u14
type Output = <u14 as BitOr<u14>>::Output
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: u14) -> <&'a u14 as BitXor<u14>>::Output
impl<T> Shr<T> for u14 where
u16: Shr<T>,
<u16 as Shr<T>>::Output == u16,
u16: Shr<T>,
<u16 as Shr<T>>::Output == u16,
impl Binary for u14
impl Default for u14
impl PartialEq<u14> for u14
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto 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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,