Struct direction::DirectionBitmap
source · pub struct DirectionBitmap {
pub raw: u8,
}
Expand description
Set of directions implemented as a bitmap
Fields
raw: u8
Implementations
sourceimpl DirectionBitmap
impl DirectionBitmap
pub const fn new(raw: u8) -> Self
pub const fn empty() -> Self
pub const fn all() -> Self
pub const fn all_cardinal() -> Self
pub const fn all_ordinal() -> Self
pub const fn has(self, direction: Direction) -> bool
pub const fn is_empty(self) -> bool
pub const fn is_full(self) -> bool
pub const fn and(self, rhs: Self) -> Self
pub const fn or(self, rhs: Self) -> Self
Trait Implementations
sourceimpl BitAnd<DirectionBitmap> for DirectionBitmap
impl BitAnd<DirectionBitmap> for DirectionBitmap
type Output = DirectionBitmap
type Output = DirectionBitmap
The resulting type after applying the
&
operator.sourceimpl BitAndAssign<DirectionBitmap> for DirectionBitmap
impl BitAndAssign<DirectionBitmap> for DirectionBitmap
sourcefn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
Performs the
&=
operation. Read moresourceimpl BitOr<DirectionBitmap> for DirectionBitmap
impl BitOr<DirectionBitmap> for DirectionBitmap
type Output = DirectionBitmap
type Output = DirectionBitmap
The resulting type after applying the
|
operator.sourceimpl BitOrAssign<DirectionBitmap> for DirectionBitmap
impl BitOrAssign<DirectionBitmap> for DirectionBitmap
sourcefn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the
|=
operation. Read moresourceimpl Clone for DirectionBitmap
impl Clone for DirectionBitmap
sourcefn clone(&self) -> DirectionBitmap
fn clone(&self) -> DirectionBitmap
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for DirectionBitmap
impl Debug for DirectionBitmap
sourceimpl Default for DirectionBitmap
impl Default for DirectionBitmap
sourceimpl Hash for DirectionBitmap
impl Hash for DirectionBitmap
sourceimpl Ord for DirectionBitmap
impl Ord for DirectionBitmap
sourcefn cmp(&self, other: &DirectionBitmap) -> Ordering
fn cmp(&self, other: &DirectionBitmap) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<DirectionBitmap> for DirectionBitmap
impl PartialEq<DirectionBitmap> for DirectionBitmap
sourcefn eq(&self, other: &DirectionBitmap) -> bool
fn eq(&self, other: &DirectionBitmap) -> bool
sourceimpl PartialOrd<DirectionBitmap> for DirectionBitmap
impl PartialOrd<DirectionBitmap> for DirectionBitmap
sourcefn partial_cmp(&self, other: &DirectionBitmap) -> Option<Ordering>
fn partial_cmp(&self, other: &DirectionBitmap) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for DirectionBitmap
impl Eq for DirectionBitmap
impl StructuralEq for DirectionBitmap
impl StructuralPartialEq for DirectionBitmap
Auto Trait Implementations
impl RefUnwindSafe for DirectionBitmap
impl Send for DirectionBitmap
impl Sync for DirectionBitmap
impl Unpin for DirectionBitmap
impl UnwindSafe for DirectionBitmap
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more