Struct FromU32

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

A built-in Zdex-compatible BitCollection for u32.

Trait Implementations§

Source§

impl<T: Into<FromU32>> BitAnd<T> for FromU32

Source§

type Output = FromU32

The resulting type after applying the & operator.
Source§

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

Performs the & operation. Read more
Source§

impl<T: Into<FromU32>> BitAndAssign<T> for FromU32

Source§

fn bitand_assign(&mut self, rhs: T)

Performs the &= operation. Read more
Source§

impl BitCollection for FromU32

Source§

const FULL: Self

A full instance with all bits set.
Source§

const EMPTY: Self

An empty instance with no bits set.
Source§

fn len(&self) -> usize

Returns the number of bits set in self. Read more
Source§

fn is_empty(&self) -> bool

Returns whether self is empty.
Source§

fn has_multiple(&self) -> bool

Returns whether self has multiple bits set.
Source§

unsafe fn lsb_unchecked(&self) -> BitU8

Returns the least significant bit in self without checking whether self is empty.
Source§

unsafe fn msb_unchecked(&self) -> BitU8

Returns the most significant bit in self without checking whether self is empty.
Source§

fn remove_lsb(&mut self)

Removes the least significant bit from self.
Source§

fn remove_msb(&mut self)

Removes the most significant bit from self.
Source§

fn pop_lsb(&mut self) -> Option<Self::Item>

Removes the least significant bit from self and returns it.
Source§

fn pop_msb(&mut self) -> Option<BitU8>

Removes the most significant bit from self and returns it.
Source§

fn contains<T: Into<Self>>(&self, x: T) -> bool

Returns whether self contains the value.
Source§

fn quantity(&self) -> Quantity

Returns the quantity of bits set. Read more
Source§

fn as_iter(&mut self) -> &mut BitIter<Self>

Returns self as an iterator over itself. Read more
Source§

fn into_bit(self) -> Option<Self::Item>

Converts self into the only bit set.
Source§

fn lsb(&self) -> Option<Self::Item>

Returns the least significant bit in self if self is not empty.
Source§

fn msb(&self) -> Option<Self::Item>

Returns the most significant bit in self if self is not empty.
Source§

fn removing<T>(self, other: T) -> Self
where T: Into<Self>,

Returns the result of removing the value from self.
Source§

fn inserting<T>(self, other: T) -> Self
where T: Into<Self>,

Returns the result of inserting the value into self.
Source§

fn toggling<T>(self, other: T) -> Self
where T: Into<Self>,

Returns the result of toggling the bits of the value in self.
Source§

fn intersecting<T>(self, other: T) -> Self
where T: Into<Self>,

Returns the result of intersecting the bits of the value with self.
Source§

fn setting<T>(self, other: T, condition: bool) -> Self
where T: Into<Self>,

Returns the result of setting the bits of the value in self based on condition.
Source§

fn remove<T>(&mut self, other: T) -> &mut Self
where T: Into<Self>,

Removes the value from self.
Source§

fn insert<T>(&mut self, other: T) -> &mut Self
where T: Into<Self>,

Inserts the value into self.
Source§

fn toggle<T>(&mut self, other: T) -> &mut Self
where T: Into<Self>,

Toggles bits of the value in self.
Source§

fn intersect<T>(&mut self, other: T) -> &mut Self
where T: Into<Self>,

Intersects the bits of the value with self.
Source§

fn set<T>(&mut self, other: T, condition: bool) -> &mut Self
where T: Into<Self>,

Sets the bits of the value in self based on condition.
Source§

impl<T: Into<FromU32>> BitOr<T> for FromU32

Source§

type Output = FromU32

The resulting type after applying the | operator.
Source§

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

Performs the | operation. Read more
Source§

impl<T: Into<FromU32>> BitOrAssign<T> for FromU32

Source§

fn bitor_assign(&mut self, rhs: T)

Performs the |= operation. Read more
Source§

impl<T: Into<FromU32>> BitXor<T> for FromU32

Source§

type Output = FromU32

The resulting type after applying the ^ operator.
Source§

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

Performs the ^ operation. Read more
Source§

impl<T: Into<FromU32>> BitXorAssign<T> for FromU32

Source§

fn bitxor_assign(&mut self, rhs: T)

Performs the ^= operation. Read more
Source§

impl Clone for FromU32

Source§

fn clone(&self) -> FromU32

Returns a duplicate 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 FromU32

Source§

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

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

impl<T: Into<FromU32>> Extend<T> for FromU32

Source§

fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<'a, T: Clone + Into<FromU32>> From<&'a T> for FromU32

Source§

fn from(r: &'a T) -> FromU32

Converts to this type from the input type.
Source§

impl<'a, T: Clone + Into<FromU32>> From<&'a mut T> for FromU32

Source§

fn from(r: &'a mut T) -> FromU32

Converts to this type from the input type.
Source§

impl From<BitIter<FromU32>> for FromU32

Source§

fn from(iter: BitIter<FromU32>) -> FromU32

Converts to this type from the input type.
Source§

impl From<BitU8> for FromU32

Source§

fn from(x: BitU8) -> FromU32

Converts to this type from the input type.
Source§

impl From<u32> for FromU32

Source§

fn from(x: u32) -> FromU32

Converts to this type from the input type.
Source§

impl<T: Into<FromU32>> FromIterator<T> for FromU32

Source§

fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl IntoIterator for FromU32

Source§

type IntoIter = BitIter<FromU32>

Which kind of iterator are we turning this into?
Source§

type Item = BitU8

The type of the elements being iterated over.
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl Not for FromU32

Source§

type Output = FromU32

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self

Performs the unary ! operation. Read more
Source§

impl<T: Into<FromU32>> Sub<T> for FromU32

Source§

type Output = FromU32

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<T: Into<FromU32>> SubAssign<T> for FromU32

Source§

fn sub_assign(&mut self, rhs: T)

Performs the -= operation. Read more
Source§

impl Copy for FromU32

Auto Trait Implementations§

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, 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> Zdexed for T
where T: BitCollection<Item = BitU8> + Copy + Debug,