Struct Boolean2

Source
#[repr(C)]
pub struct Boolean2 { pub x: bool, pub y: bool, }
Expand description

A structure that stores two-dimensional boolean data.

Fields§

§x: bool§y: bool

Implementations§

Source§

impl Boolean2

Source

pub const TRUE: Self

All elements are true.

Source

pub const FALSE: Self

All elements are false.

Source

pub const fn any(self) -> bool

Returns true if any of the elements are true.

Source

pub const fn all(self) -> bool

Returns true if all the elements are true.

Source§

impl Boolean2

Source

pub const fn xx(self) -> Boolean2

Source

pub const fn xy(self) -> Boolean2

Source

pub const fn yx(self) -> Boolean2

Source

pub const fn yy(self) -> Boolean2

Source

pub const fn xxx(self) -> Boolean3

Source

pub const fn xxy(self) -> Boolean3

Source

pub const fn xyx(self) -> Boolean3

Source

pub const fn xyy(self) -> Boolean3

Source

pub const fn yxx(self) -> Boolean3

Source

pub const fn yxy(self) -> Boolean3

Source

pub const fn yyx(self) -> Boolean3

Source

pub const fn yyy(self) -> Boolean3

Source

pub const fn xxxx(self) -> Boolean4

Source

pub const fn xxxy(self) -> Boolean4

Source

pub const fn xxyx(self) -> Boolean4

Source

pub const fn xxyy(self) -> Boolean4

Source

pub const fn xyxx(self) -> Boolean4

Source

pub const fn xyxy(self) -> Boolean4

Source

pub const fn xyyx(self) -> Boolean4

Source

pub const fn xyyy(self) -> Boolean4

Source

pub const fn yxxx(self) -> Boolean4

Source

pub const fn yxxy(self) -> Boolean4

Source

pub const fn yxyx(self) -> Boolean4

Source

pub const fn yxyy(self) -> Boolean4

Source

pub const fn yyxx(self) -> Boolean4

Source

pub const fn yyxy(self) -> Boolean4

Source

pub const fn yyyx(self) -> Boolean4

Source

pub const fn yyyy(self) -> Boolean4

Source§

impl Boolean2

Source

pub const fn new(x: bool, y: bool) -> Self

Creates with given elements.

Source

pub const fn fill(val: bool) -> Self

Fills all elements with the given values.

Source

pub const fn from_array(arr: [bool; 2]) -> Self

Creates with given array.

Source

pub const fn to_array(self) -> [bool; 2]

Convert to array.

Source

pub fn from_slice(slice: &[bool]) -> Self

Creates with given slice.

§Panics

If the length of the given array is less than the number of elements in the vector, an index out of range error occurs.

Source

pub const fn from_tuple(tuple: (bool, bool)) -> Self

Creates with given tuple.

Source

pub const fn to_tuple(self) -> (bool, bool)

Convert to tuple.

Source

pub fn set_x(self, x: bool) -> Boolean2

Sets the value of the x element.

Source

pub fn set_y(self, y: bool) -> Boolean2

Sets the value of the y element.

Trait Implementations§

Source§

impl AsMut<[bool; 2]> for Boolean2

Source§

fn as_mut(&mut self) -> &mut [bool; 2]

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl AsRef<[bool; 2]> for Boolean2

Source§

fn as_ref(&self) -> &[bool; 2]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl BitAnd for Boolean2

Source§

type Output = Boolean2

The resulting type after applying the & operator.
Source§

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

Performs the & operation. Read more
Source§

impl BitAndAssign for Boolean2

Source§

fn bitand_assign(&mut self, rhs: Self)

Performs the &= operation. Read more
Source§

impl BitOr for Boolean2

Source§

type Output = Boolean2

The resulting type after applying the | operator.
Source§

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

Performs the | operation. Read more
Source§

impl BitOrAssign for Boolean2

Source§

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
Source§

impl BitXor for Boolean2

Source§

type Output = Boolean2

The resulting type after applying the ^ operator.
Source§

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

Performs the ^ operation. Read more
Source§

impl BitXorAssign for Boolean2

Source§

fn bitxor_assign(&mut self, rhs: Self)

Performs the ^= operation. Read more
Source§

impl Clone for Boolean2

Source§

fn clone(&self) -> Boolean2

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 Boolean2

Source§

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

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

impl Default for Boolean2

Source§

fn default() -> Self

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

impl Display for Boolean2

Source§

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

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

impl From<[bool; 2]> for Boolean2

Source§

fn from(value: [bool; 2]) -> Self

Converts to this type from the input type.
Source§

impl From<(bool, bool)> for Boolean2

Source§

fn from(value: (bool, bool)) -> Self

Converts to this type from the input type.
Source§

impl From<Boolean2> for Boolean3

Source§

fn from(value: Boolean2) -> Self

Converts to this type from the input type.
Source§

impl From<Boolean2> for Boolean4

Source§

fn from(value: Boolean2) -> Self

Converts to this type from the input type.
Source§

impl From<Boolean2> for UInteger2

Source§

fn from(value: Boolean2) -> Self

Converts to this type from the input type.
Source§

impl From<Boolean3> for Boolean2

Source§

fn from(value: Boolean3) -> Self

Converts to this type from the input type.
Source§

impl From<Boolean4> for Boolean2

Source§

fn from(value: Boolean4) -> Self

Converts to this type from the input type.
Source§

impl Index<usize> for Boolean2

Source§

type Output = bool

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl IndexMut<usize> for Boolean2

Source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl Into<[bool; 2]> for Boolean2

Source§

fn into(self) -> [bool; 2]

Converts this type into the (usually inferred) input type.
Source§

impl Into<(bool, bool)> for Boolean2

Source§

fn into(self) -> (bool, bool)

Converts this type into the (usually inferred) input type.
Source§

impl Into<Boolean2> for UInteger2

Source§

fn into(self) -> Boolean2

Converts this type into the (usually inferred) input type.
Source§

impl Not for Boolean2

Source§

type Output = Boolean2

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl PartialEq for Boolean2

Source§

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

Source§

impl Eq for Boolean2

Source§

impl StructuralPartialEq for Boolean2

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.