Struct u28

Source
pub struct u28(/* private fields */);
Expand description

An unsigned integer which contains 28 bits

Implementations§

Source§

impl u28

Source

pub const MAX: u32 = 268_435_455u32

The largest value that can be stored

Source

pub const MIN: u32 = 0u32

The smallest value that can be stored

Source

pub const unsafe fn new_unchecked(value: u32) -> Self

Create a new u28 from an inner value

This method does not do any checks that the value passed is valid. To check that, use the u28::new function.

§Safety

The value must be valid value of the given type.

Source

pub fn new(value: u32) -> Option<Self>

Create a new u28 from an inner value

This method checks that the inner value is valid, and return None if it isn’t.

Source

pub const fn value(self) -> u32

Get the stored value

Trait Implementations§

Source§

impl Add for u28

Source§

type Output = u28

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl BitAnd for u28

Source§

type Output = u28

The resulting type after applying the & operator.
Source§

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

Performs the & operation. Read more
Source§

impl BitAndAssign for u28

Source§

fn bitand_assign(&mut self, rhs: Self)

Performs the &= operation. Read more
Source§

impl BitCount for u28

Source§

const COUNT: usize = 28usize

The number of bits this type takes up

Note that this is the conceptual amount it needs in a bit struct, not the amount it will use as its own variable on the stack.

Source§

impl BitOr for u28

Source§

type Output = u28

The resulting type after applying the | operator.
Source§

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

Performs the | operation. Read more
Source§

impl BitOrAssign for u28

Source§

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
Source§

impl BitXor for u28

Source§

type Output = u28

The resulting type after applying the ^ operator.
Source§

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

Performs the ^ operation. Read more
Source§

impl BitXorAssign for u28

Source§

fn bitxor_assign(&mut self, rhs: Self)

Performs the ^= operation. Read more
Source§

impl BitsFitIn<u28> for bool

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i10

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i11

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i12

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i13

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i14

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i15

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i16

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i17

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i18

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i19

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i2

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i20

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i21

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i22

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i23

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i24

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i25

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i26

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i27

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i3

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i4

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i5

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i6

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i7

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i8

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for i9

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u1

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u10

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u11

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u12

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u13

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u14

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u15

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u16

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u17

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u18

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u19

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u2

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u20

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u21

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u22

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u23

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u24

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u25

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u26

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u27

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u28

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u3

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u4

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u5

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u6

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u7

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u8

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u28> for u9

Source§

fn fit(self) -> u28

Fits self into the target type
Source§

impl BitsFitIn<u29> for u28

Source§

fn fit(self) -> u29

Fits self into the target type
Source§

impl BitsFitIn<u30> for u28

Source§

fn fit(self) -> u30

Fits self into the target type
Source§

impl BitsFitIn<u31> for u28

Source§

fn fit(self) -> u31

Fits self into the target type
Source§

impl BitsFitIn<u32> for u28

Source§

fn fit(self) -> u32

Fits self into the target type
Source§

impl BitsFitIn<u33> for u28

Source§

fn fit(self) -> u33

Fits self into the target type
Source§

impl BitsFitIn<u34> for u28

Source§

fn fit(self) -> u34

Fits self into the target type
Source§

impl BitsFitIn<u35> for u28

Source§

fn fit(self) -> u35

Fits self into the target type
Source§

impl BitsFitIn<u36> for u28

Source§

fn fit(self) -> u36

Fits self into the target type
Source§

impl BitsFitIn<u37> for u28

Source§

fn fit(self) -> u37

Fits self into the target type
Source§

impl BitsFitIn<u38> for u28

Source§

fn fit(self) -> u38

Fits self into the target type
Source§

impl BitsFitIn<u39> for u28

Source§

fn fit(self) -> u39

Fits self into the target type
Source§

impl BitsFitIn<u40> for u28

Source§

fn fit(self) -> u40

Fits self into the target type
Source§

impl BitsFitIn<u41> for u28

Source§

fn fit(self) -> u41

Fits self into the target type
Source§

impl BitsFitIn<u42> for u28

Source§

fn fit(self) -> u42

Fits self into the target type
Source§

impl BitsFitIn<u43> for u28

Source§

fn fit(self) -> u43

Fits self into the target type
Source§

impl BitsFitIn<u44> for u28

Source§

fn fit(self) -> u44

Fits self into the target type
Source§

impl BitsFitIn<u45> for u28

Source§

fn fit(self) -> u45

Fits self into the target type
Source§

impl BitsFitIn<u46> for u28

Source§

fn fit(self) -> u46

Fits self into the target type
Source§

impl BitsFitIn<u47> for u28

Source§

fn fit(self) -> u47

Fits self into the target type
Source§

impl BitsFitIn<u48> for u28

Source§

fn fit(self) -> u48

Fits self into the target type
Source§

impl BitsFitIn<u49> for u28

Source§

fn fit(self) -> u49

Fits self into the target type
Source§

impl BitsFitIn<u50> for u28

Source§

fn fit(self) -> u50

Fits self into the target type
Source§

impl BitsFitIn<u51> for u28

Source§

fn fit(self) -> u51

Fits self into the target type
Source§

impl BitsFitIn<u52> for u28

Source§

fn fit(self) -> u52

Fits self into the target type
Source§

impl BitsFitIn<u53> for u28

Source§

fn fit(self) -> u53

Fits self into the target type
Source§

impl BitsFitIn<u54> for u28

Source§

fn fit(self) -> u54

Fits self into the target type
Source§

impl BitsFitIn<u55> for u28

Source§

fn fit(self) -> u55

Fits self into the target type
Source§

impl BitsFitIn<u56> for u28

Source§

fn fit(self) -> u56

Fits self into the target type
Source§

impl BitsFitIn<u57> for u28

Source§

fn fit(self) -> u57

Fits self into the target type
Source§

impl BitsFitIn<u58> for u28

Source§

fn fit(self) -> u58

Fits self into the target type
Source§

impl BitsFitIn<u59> for u28

Source§

fn fit(self) -> u59

Fits self into the target type
Source§

impl BitsFitIn<u60> for u28

Source§

fn fit(self) -> u60

Fits self into the target type
Source§

impl BitsFitIn<u61> for u28

Source§

fn fit(self) -> u61

Fits self into the target type
Source§

impl BitsFitIn<u62> for u28

Source§

fn fit(self) -> u62

Fits self into the target type
Source§

impl BitsFitIn<u63> for u28

Source§

fn fit(self) -> u63

Fits self into the target type
Source§

impl BitsFitIn<u64> for u28

Source§

fn fit(self) -> u64

Fits self into the target type
Source§

impl Bounded for u28

Source§

fn min_value() -> Self

Returns the smallest finite number this type can represent
Source§

fn max_value() -> Self

Returns the largest finite number this type can represent
Source§

impl Clone for u28

Source§

fn clone(&self) -> u28

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 Debug for u28

Source§

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

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

impl Default for u28

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for u28

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for u28

Source§

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

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

impl Div for u28

Source§

type Output = u28

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl FieldStorage for u28

Source§

type StoredType = u32

The type this field stores as
Source§

fn inner_raw(self) -> Self::StoredType

Get the raw representation of this value
Source§

impl FromStr for u28

Source§

type Err = <u28 as Num>::FromStrRadixErr

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for u28

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Mul for u28

Source§

type Output = u28

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl Num for u28

Source§

type FromStrRadixErr = ()

Source§

fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>

Convert from a string and radix (typically 2..=36). Read more
Source§

impl One for u28

Source§

fn one() -> Self

Returns the multiplicative identity element of Self, 1. Read more
Source§

fn set_one(&mut self)

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

fn is_one(&self) -> bool
where Self: PartialEq,

Returns true if self is equal to the multiplicative identity. Read more
Source§

impl Ord for u28

Source§

fn cmp(&self, other: &u28) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for u28

Source§

fn eq(&self, other: &u28) -> 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 PartialOrd for u28

Source§

fn partial_cmp(&self, other: &u28) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Rem for u28

Source§

type Output = u28

The resulting type after applying the % operator.
Source§

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

Performs the % operation. Read more
Source§

impl Serialize for u28

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Shl<usize> for u28

Source§

type Output = u28

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

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

Performs the << operation. Read more
Source§

impl ShlAssign<usize> for u28

Source§

fn shl_assign(&mut self, rhs: usize)

Performs the <<= operation. Read more
Source§

impl Shr<usize> for u28

Source§

type Output = u28

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

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

Performs the >> operation. Read more
Source§

impl ShrAssign<usize> for u28

Source§

fn shr_assign(&mut self, rhs: usize)

Performs the >>= operation. Read more
Source§

impl Sub for u28

Source§

type Output = u28

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<P> ValidCheck<P> for u28

Source§

const ALWAYS_VALID: bool = true

Set this to true if, at compile-time, we can tell that all bit representations which contain the appropriate number of bits are valid representations of this type
Source§

fn is_valid(_input: P) -> bool

Return whether or not the underlying bits of P are valid representation of this type
Source§

impl Zero for u28

Source§

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more
Source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
Source§

fn set_zero(&mut self)

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

impl Copy for u28

Source§

impl Eq for u28

Source§

impl StructuralPartialEq for u28

Auto Trait Implementations§

§

impl Freeze for u28

§

impl RefUnwindSafe for u28

§

impl Send for u28

§

impl Sync for u28

§

impl Unpin for u28

§

impl UnwindSafe for u28

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> BitStructZero for T
where T: Zero,

Source§

fn bs_zero() -> Self

Get a zero value for this bit struct
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> LowerBounded for T
where T: Bounded,

Source§

fn min_value() -> T

Returns the smallest finite number this type can represent
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.
Source§

impl<T> UpperBounded for T
where T: Bounded,

Source§

fn max_value() -> T

Returns the largest finite number this type can represent
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

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>,