Struct lazy_bytes_cast::Bits

source ·
#[repr(transparent)]
pub struct Bits<T>(pub T);
Expand description

Wrapper to provide access to bit fields

use lazy_bytes_cast::Bits;

let mut bits = Bits(u32::max_value());
assert!(!bits.empty());

assert!(bits.get(1));

bits = bits.set(1);
assert!(bits.get(1));

bits = bits.toggle(1);
assert!(!bits.get(1));

bits = bits.unset(1);
assert!(!bits.get(1));

bits = bits.toggle(1);
assert!(bits.get(1));

bits = bits.reset();
assert_eq!(bits, 0);
assert!(bits.empty());

assert!(!bits.get(1));

assert_eq!(bits.len(), core::mem::size_of_val(&bits) * 8);

bits = Bits(u32::min_value());
assert!(bits.empty());
assert!(!bits.get(1));

bits = bits.set(1);
assert!(bits.get(1));

bits = bits.unset(1);
assert!(!bits.get(1));

bits = bits.set(26);
assert!(bits.get(26));
assert!(bits.get(90)); //90 % 32 == 26
bits = bits.set(91);
assert!(bits.get(26));

bits = bits.flip();
assert!(!bits.get(26));
assert!(bits.get(5));

Tuple Fields§

§0: T

Implementations§

source§

impl Bits<u8>

source

pub const fn get(&self, idx: u32) -> bool

Get bit by index.

source

pub const fn set(self, idx: u32) -> Self

Set bit by index and return updated value.

source

pub const fn unset(self, idx: u32) -> Self

Unset bit by index and return updated value.

source

pub const fn toggle(self, idx: u32) -> Self

Unset bit by index and return updated value.

source

pub const fn empty(&self) -> bool

Returns whether all bits are unset

source

pub const fn reset(&self) -> Self

Unset all bits and returns updated value

source

pub const fn flip(&self) -> Self

Flip all bits and returns updated value

source

pub const fn len(&self) -> usize

Returns number of bits inside.

source

pub const fn size() -> usize

Returns number of bits inside.

source§

impl Bits<u16>

source

pub const fn get(&self, idx: u32) -> bool

Get bit by index.

source

pub const fn set(self, idx: u32) -> Self

Set bit by index and return updated value.

source

pub const fn unset(self, idx: u32) -> Self

Unset bit by index and return updated value.

source

pub const fn toggle(self, idx: u32) -> Self

Unset bit by index and return updated value.

source

pub const fn empty(&self) -> bool

Returns whether all bits are unset

source

pub const fn reset(&self) -> Self

Unset all bits and returns updated value

source

pub const fn flip(&self) -> Self

Flip all bits and returns updated value

source

pub const fn len(&self) -> usize

Returns number of bits inside.

source

pub const fn size() -> usize

Returns number of bits inside.

source§

impl Bits<u32>

source

pub const fn get(&self, idx: u32) -> bool

Get bit by index.

source

pub const fn set(self, idx: u32) -> Self

Set bit by index and return updated value.

source

pub const fn unset(self, idx: u32) -> Self

Unset bit by index and return updated value.

source

pub const fn toggle(self, idx: u32) -> Self

Unset bit by index and return updated value.

source

pub const fn empty(&self) -> bool

Returns whether all bits are unset

source

pub const fn reset(&self) -> Self

Unset all bits and returns updated value

source

pub const fn flip(&self) -> Self

Flip all bits and returns updated value

source

pub const fn len(&self) -> usize

Returns number of bits inside.

source

pub const fn size() -> usize

Returns number of bits inside.

source§

impl Bits<u64>

source

pub const fn get(&self, idx: u32) -> bool

Get bit by index.

source

pub const fn set(self, idx: u32) -> Self

Set bit by index and return updated value.

source

pub const fn unset(self, idx: u32) -> Self

Unset bit by index and return updated value.

source

pub const fn toggle(self, idx: u32) -> Self

Unset bit by index and return updated value.

source

pub const fn empty(&self) -> bool

Returns whether all bits are unset

source

pub const fn reset(&self) -> Self

Unset all bits and returns updated value

source

pub const fn flip(&self) -> Self

Flip all bits and returns updated value

source

pub const fn len(&self) -> usize

Returns number of bits inside.

source

pub const fn size() -> usize

Returns number of bits inside.

source§

impl Bits<u128>

source

pub const fn get(&self, idx: u32) -> bool

Get bit by index.

source

pub const fn set(self, idx: u32) -> Self

Set bit by index and return updated value.

source

pub const fn unset(self, idx: u32) -> Self

Unset bit by index and return updated value.

source

pub const fn toggle(self, idx: u32) -> Self

Unset bit by index and return updated value.

source

pub const fn empty(&self) -> bool

Returns whether all bits are unset

source

pub const fn reset(&self) -> Self

Unset all bits and returns updated value

source

pub const fn flip(&self) -> Self

Flip all bits and returns updated value

source

pub const fn len(&self) -> usize

Returns number of bits inside.

source

pub const fn size() -> usize

Returns number of bits inside.

source§

impl Bits<usize>

source

pub const fn get(&self, idx: u32) -> bool

Get bit by index.

source

pub const fn set(self, idx: u32) -> Self

Set bit by index and return updated value.

source

pub const fn unset(self, idx: u32) -> Self

Unset bit by index and return updated value.

source

pub const fn toggle(self, idx: u32) -> Self

Unset bit by index and return updated value.

source

pub const fn empty(&self) -> bool

Returns whether all bits are unset

source

pub const fn reset(&self) -> Self

Unset all bits and returns updated value

source

pub const fn flip(&self) -> Self

Flip all bits and returns updated value

source

pub const fn len(&self) -> usize

Returns number of bits inside.

source

pub const fn size() -> usize

Returns number of bits inside.

source§

impl Bits<i8>

source

pub const fn get(&self, idx: u32) -> bool

Get bit by index.

source

pub const fn set(self, idx: u32) -> Self

Set bit by index and return updated value.

source

pub const fn unset(self, idx: u32) -> Self

Unset bit by index and return updated value.

source

pub const fn toggle(self, idx: u32) -> Self

Unset bit by index and return updated value.

source

pub const fn empty(&self) -> bool

Returns whether all bits are unset

source

pub const fn reset(&self) -> Self

Unset all bits and returns updated value

source

pub const fn flip(&self) -> Self

Flip all bits and returns updated value

source

pub const fn len(&self) -> usize

Returns number of bits inside.

source

pub const fn size() -> usize

Returns number of bits inside.

source§

impl Bits<i16>

source

pub const fn get(&self, idx: u32) -> bool

Get bit by index.

source

pub const fn set(self, idx: u32) -> Self

Set bit by index and return updated value.

source

pub const fn unset(self, idx: u32) -> Self

Unset bit by index and return updated value.

source

pub const fn toggle(self, idx: u32) -> Self

Unset bit by index and return updated value.

source

pub const fn empty(&self) -> bool

Returns whether all bits are unset

source

pub const fn reset(&self) -> Self

Unset all bits and returns updated value

source

pub const fn flip(&self) -> Self

Flip all bits and returns updated value

source

pub const fn len(&self) -> usize

Returns number of bits inside.

source

pub const fn size() -> usize

Returns number of bits inside.

source§

impl Bits<i32>

source

pub const fn get(&self, idx: u32) -> bool

Get bit by index.

source

pub const fn set(self, idx: u32) -> Self

Set bit by index and return updated value.

source

pub const fn unset(self, idx: u32) -> Self

Unset bit by index and return updated value.

source

pub const fn toggle(self, idx: u32) -> Self

Unset bit by index and return updated value.

source

pub const fn empty(&self) -> bool

Returns whether all bits are unset

source

pub const fn reset(&self) -> Self

Unset all bits and returns updated value

source

pub const fn flip(&self) -> Self

Flip all bits and returns updated value

source

pub const fn len(&self) -> usize

Returns number of bits inside.

source

pub const fn size() -> usize

Returns number of bits inside.

source§

impl Bits<i64>

source

pub const fn get(&self, idx: u32) -> bool

Get bit by index.

source

pub const fn set(self, idx: u32) -> Self

Set bit by index and return updated value.

source

pub const fn unset(self, idx: u32) -> Self

Unset bit by index and return updated value.

source

pub const fn toggle(self, idx: u32) -> Self

Unset bit by index and return updated value.

source

pub const fn empty(&self) -> bool

Returns whether all bits are unset

source

pub const fn reset(&self) -> Self

Unset all bits and returns updated value

source

pub const fn flip(&self) -> Self

Flip all bits and returns updated value

source

pub const fn len(&self) -> usize

Returns number of bits inside.

source

pub const fn size() -> usize

Returns number of bits inside.

source§

impl Bits<i128>

source

pub const fn get(&self, idx: u32) -> bool

Get bit by index.

source

pub const fn set(self, idx: u32) -> Self

Set bit by index and return updated value.

source

pub const fn unset(self, idx: u32) -> Self

Unset bit by index and return updated value.

source

pub const fn toggle(self, idx: u32) -> Self

Unset bit by index and return updated value.

source

pub const fn empty(&self) -> bool

Returns whether all bits are unset

source

pub const fn reset(&self) -> Self

Unset all bits and returns updated value

source

pub const fn flip(&self) -> Self

Flip all bits and returns updated value

source

pub const fn len(&self) -> usize

Returns number of bits inside.

source

pub const fn size() -> usize

Returns number of bits inside.

source§

impl Bits<isize>

source

pub const fn get(&self, idx: u32) -> bool

Get bit by index.

source

pub const fn set(self, idx: u32) -> Self

Set bit by index and return updated value.

source

pub const fn unset(self, idx: u32) -> Self

Unset bit by index and return updated value.

source

pub const fn toggle(self, idx: u32) -> Self

Unset bit by index and return updated value.

source

pub const fn empty(&self) -> bool

Returns whether all bits are unset

source

pub const fn reset(&self) -> Self

Unset all bits and returns updated value

source

pub const fn flip(&self) -> Self

Flip all bits and returns updated value

source

pub const fn len(&self) -> usize

Returns number of bits inside.

source

pub const fn size() -> usize

Returns number of bits inside.

Methods from Deref<Target = i16>§

1.43.0 · source

pub const MIN: i16 = -32_768i16

1.43.0 · source

pub const MAX: i16 = 32_767i16

1.53.0 · source

pub const BITS: u32 = 16u32

Trait Implementations§

source§

impl Binary for Bits<i128>

source§

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

Formats the value using the given formatter.
source§

impl Binary for Bits<i16>

source§

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

Formats the value using the given formatter.
source§

impl Binary for Bits<i32>

source§

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

Formats the value using the given formatter.
source§

impl Binary for Bits<i64>

source§

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

Formats the value using the given formatter.
source§

impl Binary for Bits<i8>

source§

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

Formats the value using the given formatter.
source§

impl Binary for Bits<isize>

source§

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

Formats the value using the given formatter.
source§

impl Binary for Bits<u128>

source§

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

Formats the value using the given formatter.
source§

impl Binary for Bits<u16>

source§

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

Formats the value using the given formatter.
source§

impl Binary for Bits<u32>

source§

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

Formats the value using the given formatter.
source§

impl Binary for Bits<u64>

source§

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

Formats the value using the given formatter.
source§

impl Binary for Bits<u8>

source§

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

Formats the value using the given formatter.
source§

impl Binary for Bits<usize>

source§

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

Formats the value using the given formatter.
source§

impl<T: Clone> Clone for Bits<T>

source§

fn clone(&self) -> Bits<T>

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 Bits<i128>

source§

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

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

impl Debug for Bits<i16>

source§

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

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

impl Debug for Bits<i32>

source§

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

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

impl Debug for Bits<i64>

source§

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

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

impl Debug for Bits<i8>

source§

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

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

impl Debug for Bits<isize>

source§

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

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

impl Debug for Bits<u128>

source§

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

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

impl Debug for Bits<u16>

source§

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

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

impl Debug for Bits<u32>

source§

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

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

impl Debug for Bits<u64>

source§

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

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

impl Debug for Bits<u8>

source§

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

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

impl Debug for Bits<usize>

source§

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

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

impl<T: Default> Default for Bits<T>

source§

fn default() -> Bits<T>

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

impl Deref for Bits<i128>

§

type Target = i128

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Deref for Bits<i16>

§

type Target = i16

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Deref for Bits<i32>

§

type Target = i32

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Deref for Bits<i64>

§

type Target = i64

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Deref for Bits<i8>

§

type Target = i8

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Deref for Bits<isize>

§

type Target = isize

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Deref for Bits<u128>

§

type Target = u128

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Deref for Bits<u16>

§

type Target = u16

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Deref for Bits<u32>

§

type Target = u32

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Deref for Bits<u64>

§

type Target = u64

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Deref for Bits<u8>

§

type Target = u8

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Deref for Bits<usize>

§

type Target = usize

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Bits<i128>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl DerefMut for Bits<i16>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl DerefMut for Bits<i32>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl DerefMut for Bits<i64>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl DerefMut for Bits<i8>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl DerefMut for Bits<isize>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl DerefMut for Bits<u128>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl DerefMut for Bits<u16>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl DerefMut for Bits<u32>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl DerefMut for Bits<u64>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl DerefMut for Bits<u8>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl DerefMut for Bits<usize>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Display for Bits<i128>

source§

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

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

impl Display for Bits<i16>

source§

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

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

impl Display for Bits<i32>

source§

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

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

impl Display for Bits<i64>

source§

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

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

impl Display for Bits<i8>

source§

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

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

impl Display for Bits<isize>

source§

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

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

impl Display for Bits<u128>

source§

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

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

impl Display for Bits<u16>

source§

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

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

impl Display for Bits<u32>

source§

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

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

impl Display for Bits<u64>

source§

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

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

impl Display for Bits<u8>

source§

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

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

impl Display for Bits<usize>

source§

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

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

impl From<i128> for Bits<i128>

source§

fn from(val: i128) -> Self

Converts to this type from the input type.
source§

impl From<i16> for Bits<i16>

source§

fn from(val: i16) -> Self

Converts to this type from the input type.
source§

impl From<i32> for Bits<i32>

source§

fn from(val: i32) -> Self

Converts to this type from the input type.
source§

impl From<i64> for Bits<i64>

source§

fn from(val: i64) -> Self

Converts to this type from the input type.
source§

impl From<i8> for Bits<i8>

source§

fn from(val: i8) -> Self

Converts to this type from the input type.
source§

impl From<isize> for Bits<isize>

source§

fn from(val: isize) -> Self

Converts to this type from the input type.
source§

impl From<u128> for Bits<u128>

source§

fn from(val: u128) -> Self

Converts to this type from the input type.
source§

impl From<u16> for Bits<u16>

source§

fn from(val: u16) -> Self

Converts to this type from the input type.
source§

impl From<u32> for Bits<u32>

source§

fn from(val: u32) -> Self

Converts to this type from the input type.
source§

impl From<u64> for Bits<u64>

source§

fn from(val: u64) -> Self

Converts to this type from the input type.
source§

impl From<u8> for Bits<u8>

source§

fn from(val: u8) -> Self

Converts to this type from the input type.
source§

impl From<usize> for Bits<usize>

source§

fn from(val: usize) -> Self

Converts to this type from the input type.
source§

impl Hash for Bits<i128>

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 Hash for Bits<i16>

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 Hash for Bits<i32>

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 Hash for Bits<i64>

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 Hash for Bits<i8>

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 Hash for Bits<isize>

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 Hash for Bits<u128>

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 Hash for Bits<u16>

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 Hash for Bits<u32>

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 Hash for Bits<u64>

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 Hash for Bits<u8>

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 Hash for Bits<usize>

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 Into<i128> for Bits<i128>

source§

fn into(self) -> i128

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

impl Into<i16> for Bits<i16>

source§

fn into(self) -> i16

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

impl Into<i32> for Bits<i32>

source§

fn into(self) -> i32

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

impl Into<i64> for Bits<i64>

source§

fn into(self) -> i64

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

impl Into<i8> for Bits<i8>

source§

fn into(self) -> i8

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

impl Into<isize> for Bits<isize>

source§

fn into(self) -> isize

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

impl Into<u128> for Bits<u128>

source§

fn into(self) -> u128

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

impl Into<u16> for Bits<u16>

source§

fn into(self) -> u16

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

impl Into<u32> for Bits<u32>

source§

fn into(self) -> u32

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

impl Into<u64> for Bits<u64>

source§

fn into(self) -> u64

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

impl Into<u8> for Bits<u8>

source§

fn into(self) -> u8

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

impl Into<usize> for Bits<usize>

source§

fn into(self) -> usize

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

impl PartialEq<Bits<i128>> for i128

source§

fn eq(&self, other: &Bits<i128>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Bits<i16>> for i16

source§

fn eq(&self, other: &Bits<i16>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Bits<i32>> for i32

source§

fn eq(&self, other: &Bits<i32>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Bits<i64>> for i64

source§

fn eq(&self, other: &Bits<i64>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Bits<i8>> for i8

source§

fn eq(&self, other: &Bits<i8>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Bits<isize>> for isize

source§

fn eq(&self, other: &Bits<isize>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Bits<u128>> for u128

source§

fn eq(&self, other: &Bits<u128>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Bits<u16>> for u16

source§

fn eq(&self, other: &Bits<u16>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Bits<u32>> for u32

source§

fn eq(&self, other: &Bits<u32>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Bits<u64>> for u64

source§

fn eq(&self, other: &Bits<u64>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Bits<u8>> for u8

source§

fn eq(&self, other: &Bits<u8>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Bits<usize>> for usize

source§

fn eq(&self, other: &Bits<usize>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<i128> for Bits<i128>

source§

fn eq(&self, other: &i128) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<i16> for Bits<i16>

source§

fn eq(&self, other: &i16) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<i32> for Bits<i32>

source§

fn eq(&self, other: &i32) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<i64> for Bits<i64>

source§

fn eq(&self, other: &i64) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<i8> for Bits<i8>

source§

fn eq(&self, other: &i8) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<isize> for Bits<isize>

source§

fn eq(&self, other: &isize) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<u128> for Bits<u128>

source§

fn eq(&self, other: &u128) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<u16> for Bits<u16>

source§

fn eq(&self, other: &u16) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<u32> for Bits<u32>

source§

fn eq(&self, other: &u32) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<u64> for Bits<u64>

source§

fn eq(&self, other: &u64) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<u8> for Bits<u8>

source§

fn eq(&self, other: &u8) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<usize> for Bits<usize>

source§

fn eq(&self, other: &usize) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: Copy> Copy for Bits<T>

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for Bits<T>where T: RefUnwindSafe,

§

impl<T> Send for Bits<T>where T: Send,

§

impl<T> Sync for Bits<T>where T: Sync,

§

impl<T> Unpin for Bits<T>where T: Unpin,

§

impl<T> UnwindSafe for Bits<T>where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.