Skip to main content
← PSoXide SDK guides and examples · SDK 80d1c329e977 · All Cargo features enabled; check feature gates before use.

Mask64

Struct Mask64 

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

A set of up to 64 flags in two words: what a u64 bit mask was used for. It does no arithmetic, so it needs no wide integer at all.

Implementations§

Source§

impl Mask64

Source

pub const EMPTY: Mask64

No bit set.

Source

pub fn set(&mut self, bit: usize)

Set bit (0..64).

Source

pub fn clear(&mut self, bit: usize)

Clear bit (0..64).

Source

pub fn assign(&mut self, bit: usize, value: bool)

Set or clear bit (0..64).

Source

pub fn test(&self, bit: usize) -> bool

Is bit set? A bit past 63 is not.

Source

pub const fn from_words(low: u32, high: u32) -> Mask64

The set with bits low (0..32) and high (32..64) as given: the two words of a stored or transmitted mask.

Source

pub const fn low(self) -> u32

Bits 0..32.

Source

pub const fn high(self) -> u32

Bits 32..64.

Source

pub const fn bit(bit: usize) -> Mask64

The set holding only bit (empty for a bit past 63).

Source

pub const fn first(count: usize) -> Mask64

The set of the lowest count bits (all 64 for a count of 64 or more).

Source

pub const fn is_empty(self) -> bool

Is no bit set?

Source

pub const fn or(self, o: Mask64) -> Mask64

The bits set in either.

Source

pub const fn and(self, o: Mask64) -> Mask64

The bits set in both.

Source

pub const fn and_not(self, o: Mask64) -> Mask64

The bits set in self and not in o.

Trait Implementations§

Source§

impl Clone for Mask64

Source§

fn clone(&self) -> Mask64

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 Mask64

Source§

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

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

impl PartialEq for Mask64

Source§

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

Source§

impl Eq for Mask64

Source§

impl StructuralPartialEq for Mask64

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