Trait bittle::BitsOwned

source ·
pub trait BitsOwned: BitsMut {
    type IntoIterOnes: Iterator<Item = u32>;
    type IntoIterOnesIn<E>: Iterator<Item = u32>
       where E: Endian;
    type IntoIterZeros: Iterator<Item = u32>;
    type IntoIterZerosIn<E>: Iterator<Item = u32>
       where E: Endian;

    const BITS: u32;
    const ZEROS: Self;
    const ONES: Self;
Show 22 methods // Required methods fn zeros() -> Self; fn ones() -> Self; fn with_bit_in<E>(self, bit: u32) -> Self where E: Endian; fn with_bit(self, bit: u32) -> Self; fn without_bit_in<E>(self, bit: u32) -> Self where E: Endian; fn without_bit(self, bit: u32) -> Self; fn union(self, other: Self) -> Self; fn conjunction(self, other: Self) -> Self; fn difference(self, other: Self) -> Self; fn symmetric_difference(self, other: Self) -> Self; fn into_iter_ones(self) -> Self::IntoIterOnes; fn into_iter_ones_in<E>(self) -> Self::IntoIterOnesIn<E> where E: Endian; fn into_iter_zeros(self) -> Self::IntoIterZeros; fn into_iter_zeros_in<E>(self) -> Self::IntoIterZerosIn<E> where E: Endian; // Provided methods fn with_bit_le(self, bit: u32) -> Self where Self: Sized { ... } fn with_bit_be(self, bit: u32) -> Self where Self: Sized { ... } fn without_bit_le(self, bit: u32) -> Self where Self: Sized { ... } fn without_bit_be(self, bit: u32) -> Self where Self: Sized { ... } fn into_iter_ones_le(self) -> Self::IntoIterOnesIn<LittleEndian> where Self: Sized { ... } fn into_iter_ones_be(self) -> Self::IntoIterOnesIn<BigEndian> where Self: Sized { ... } fn into_iter_zeros_le(self) -> Self::IntoIterZerosIn<LittleEndian> where Self: Sized { ... } fn into_iter_zeros_be(self) -> Self::IntoIterZerosIn<BigEndian> where Self: Sized { ... }
}
Expand description

Bitset owned operations.

This is implemented for primitive types such as:

  • usize, u32, u64, and other signed numbers.
  • Arrays made up of numerical primitives, such as [u32; 32].

In contrast to Bits and BitsMut this is not implemented for slices such as &[u32]. This is since the operations provided here require ownership of the underlying data.

Also see the associated sibling traits:

  • Bits for immutable operations.
  • BitsMut for mutable operations.

Examples

use bittle::{Bits, BitsOwned};

let a = u128::zeros();
let b = bittle::set!(77);

assert!(!a.test_bit(77));
assert!(a.union(b).test_bit(77));

The bit set can also use arrays as its backing storage.

use bittle::{Bits, BitsOwned};

let a = <[u32; 4]>::zeros();
let b = bittle::set!(77);

assert!(!a.test_bit(77));
assert!(a.union(b).test_bit(77));

Required Associated Types§

source

type IntoIterOnes: Iterator<Item = u32>

Owning iterator over bits set to ones using DefaultEndian indexing.

See BitsOwned::into_iter_ones.

source

type IntoIterOnesIn<E>: Iterator<Item = u32> where E: Endian

Owning iterator over bits set to ones using custom Endian indexing.

See BitsOwned::into_iter_ones_in.

source

type IntoIterZeros: Iterator<Item = u32>

Owning iterator over bits set to zero using the DefaultEndian ordering.

See BitsOwned::into_iter_zeros.

source

type IntoIterZerosIn<E>: Iterator<Item = u32> where E: Endian

Owning iterator over bits set to zero using custom Endian ordering.

See BitsOwned::into_iter_zeros_in.

Required Associated Constants§

source

const BITS: u32

The number of bits in the bit set.

Examples
use bittle::BitsOwned;

assert_eq!(u32::BITS, 32);
assert_eq!(<[u32; 4]>::BITS, 128);
source

const ZEROS: Self

The bit pattern containing all zeros, or one that is empty.

See BitsOwned::zeros.

Examples
use bittle::BitsOwned;

assert_eq!(u32::ZEROS, 0);
assert_eq!(<[u32; 4]>::ZEROS, [0, 0, 0, 0]);
source

const ONES: Self

The bit pattern containing all ones, or one that is full.

See BitsOwned::ones.

Examples
use bittle::BitsOwned;

assert_eq!(u32::ONES, u32::MAX);
assert_eq!(<[u32; 4]>::ONES, [u32::MAX, u32::MAX, u32::MAX, u32::MAX]);

Required Methods§

source

fn zeros() -> Self

Construct a bit set of all zeros, or one that is empty.

Examples
use bittle::{Bits, BitsOwned};

let set = u128::zeros();
assert!(set.all_zeros());
assert_eq!(set.iter_ones().count(), 0);
source

fn ones() -> Self

Construct a bit set of all ones, or one that is full.

Examples
use bittle::{Bits, BitsOwned};

let set = u128::ones();
assert!(set.all_ones());
assert!(set.iter_ones().eq(0..128))
source

fn with_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

Set the given bit and return the modified set.

Examples
use bittle::{Bits, BitsOwned, LittleEndian};

let set = u128::zeros().with_bit_in::<LittleEndian>(8).with_bit_in::<LittleEndian>(12);
assert!(set.iter_ones_in::<LittleEndian>().eq([8, 12]))

Using a larger set:

use bittle::{Bits, BitsOwned, LittleEndian};

let set = <[u32; 4]>::zeros().with_bit_in::<LittleEndian>(8).with_bit_in::<LittleEndian>(12);
assert!(set.iter_ones_in::<LittleEndian>().eq([8, 12]))
source

fn with_bit(self, bit: u32) -> Self

Set the given bit and return the modified set with the DefaultEndian indexing.

Examples
use bittle::{Bits, BitsOwned};

let set = u128::zeros().with_bit(8).with_bit(12);
assert!(set.iter_ones().eq([8, 12]))

Using a larger set:

use bittle::{Bits, BitsOwned};

let set = <[u32; 4]>::zeros().with_bit(8).with_bit(12);
assert!(set.iter_ones().eq([8, 12]))
source

fn without_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

Set the given bit and return the modified set using custom Endian indexing.

Examples
use bittle::{Bits, BitsOwned, LittleEndian};

let set = u8::ones().without_bit_in::<LittleEndian>(2);
assert!(set.iter_ones_in::<LittleEndian>().eq([0, 1, 3, 4, 5, 6, 7]))

Using a larger set:

use bittle::{Bits, BitsOwned, LittleEndian};

let set = <[u8; 2]>::ones().without_bit_in::<LittleEndian>(2).without_bit_in::<LittleEndian>(10);
assert!(set.iter_ones_in::<LittleEndian>().eq([0, 1, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15]))
source

fn without_bit(self, bit: u32) -> Self

Set the given bit and return the modified set using DefaultEndian indexing.

Examples
use bittle::{Bits, BitsOwned};

let set = u8::ones().without_bit(2);
assert!(set.iter_ones().eq([0, 1, 3, 4, 5, 6, 7]))

Using a larger set:

use bittle::{Bits, BitsOwned};

let set = <[u8; 2]>::ones().without_bit(2).without_bit(10);
assert!(set.iter_ones().eq([0, 1, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15]))
source

fn union(self, other: Self) -> Self

Construct the union between this and another set.

A union retains all elements from both sets.

In terms of numerical operations, this is equivalent to BitOr or a | b.

Examples
use bittle::{Bits, BitsOwned};

let a: u128 = bittle::set![31, 67];
let b: u128 = bittle::set![31, 62];

let c = a.union(b);
assert!(c.iter_ones().eq([31, 62, 67]));

Using a larger set:

use bittle::{Bits, BitsOwned};

let a: [u32; 4] = bittle::set![31, 67];
let b: [u32; 4] = bittle::set![31, 62];

let c = a.union(b);
assert!(c.iter_ones().eq([31, 62, 67]));
source

fn conjunction(self, other: Self) -> Self

Construct a conjunction of this and another set.

A conjunction keeps the elements which are in common between two sets.

In terms of numerical operations, this is equivalent to BitAnd or a & b.

Examples
use bittle::{Bits, BitsOwned};

let a: u128 = bittle::set![31, 67];
let b: u128 = bittle::set![31, 62];

let c = a.conjunction(b);
assert!(c.iter_ones().eq([31]));

Using a larger set:

use bittle::{Bits, BitsOwned};

let a: [u32; 4] = bittle::set![31, 67];
let b: [u32; 4] = bittle::set![31, 62];

let c = a.conjunction(b);
assert!(c.iter_ones().eq([31]));
source

fn difference(self, other: Self) -> Self

Construct the difference between this and another set.

This returns the elements in the first set which are not part of the second.

Examples
use bittle::{Set, Bits, BitsOwned};

let a: u128 = bittle::set![31, 67];
let b: u128 = bittle::set![31, 62];

let c = a.difference(b);
assert!(c.iter_ones().eq([67]));

Using a larger set:

use bittle::{Bits, BitsOwned};

let a: [u32; 4] = bittle::set![31, 67];
let b: [u32; 4] = bittle::set![31, 62];

let c = a.difference(b);
assert!(c.iter_ones().eq([67]));
source

fn symmetric_difference(self, other: Self) -> Self

Construct the symmetric difference between this and another set.

This retains elements which are unique to each set.

In terms of numerical operations, this is equivalent to BitXor or a ^ b.

Examples
use bittle::{Bits, BitsOwned};

let a: u128 = bittle::set![31, 67];
let b: u128 = bittle::set![31, 62];

let c = a.symmetric_difference(b);
assert!(c.iter_ones().eq([62, 67]));

Using a larger set:

use bittle::{Bits, BitsOwned};

let a: [u32; 4] = bittle::set![31, 67];
let b: [u32; 4] = bittle::set![31, 62];

let c = a.symmetric_difference(b);
assert!(c.iter_ones().eq([62, 67]));
source

fn into_iter_ones(self) -> Self::IntoIterOnes

Construct an owning iterator over all ones in a set using the DefaultEndian indexing.

Will iterate through elements from smallest to largest index.

Examples
use bittle::{Bits, BitsOwned};

let a: u128 = bittle::set![3, 7];
assert!(a.into_iter_ones().eq([3, 7]));

Using a larger set:

use bittle::{Bits, BitsOwned};

let a: [u32; 4] = bittle::set![4, 63, 71, 127];
assert!(a.into_iter_ones().eq([4, 63, 71, 127]));
assert!(a.into_iter_ones().rev().eq([127, 71, 63, 4]));
source

fn into_iter_ones_in<E>(self) -> Self::IntoIterOnesIn<E>where E: Endian,

Construct an owning iterator over all ones in a set using custom Endian indexing.

Will iterate through elements from smallest to largest index.

Examples
use bittle::{Bits, BitsOwned, LittleEndian};

let a: u128 = bittle::set_le![3, 7];
assert!(a.into_iter_ones_in::<LittleEndian>().eq([3, 7]));

Using a larger set:

use bittle::{Bits, BitsOwned, LittleEndian};

let a: [u32; 4] = bittle::set_le![4, 63, 71];
assert!(a.into_iter_ones_in::<LittleEndian>().eq([4, 63, 71]));
source

fn into_iter_zeros(self) -> Self::IntoIterZeros

Construct an owning iterator over all zeros in a set using DefaultEndian indexing.

Will iterate through elements from smallest to largest index.

Examples
use bittle::{Bits, BitsOwned};

let a: u16 = bittle::set![4, 7, 10];
assert!(a.into_iter_zeros().eq([0, 1, 2, 3, 5, 6, 8, 9, 11, 12, 13, 14, 15]));

Using a larger set:

use bittle::{Bits, BitsOwned};

let a: [u8; 2] = bittle::set![4, 7, 10];
assert!(a.into_iter_zeros().eq([0, 1, 2, 3, 5, 6, 8, 9, 11, 12, 13, 14, 15]));
assert!(a.into_iter_zeros().rev().eq([15, 14, 13, 12, 11, 9, 8, 6, 5, 3, 2, 1, 0]));
source

fn into_iter_zeros_in<E>(self) -> Self::IntoIterZerosIn<E>where E: Endian,

Construct an owning iterator over all zeros in a set using custom Endian indexing.

Will iterate through elements from smallest to largest index.

Examples
use bittle::{Bits, BitsOwned, LittleEndian};

let a: u16 = bittle::set_le![4, 7, 10];
assert!(a.into_iter_zeros_in::<LittleEndian>().eq([0, 1, 2, 3, 5, 6, 8, 9, 11, 12, 13, 14, 15]));

Using a larger set:

use bittle::{Bits, BitsOwned, LittleEndian};

let a: [u8; 2] = bittle::set_le![4, 7, 10];
assert!(a.into_iter_zeros_in::<LittleEndian>().eq([0, 1, 2, 3, 5, 6, 8, 9, 11, 12, 13, 14, 15]));

Provided Methods§

source

fn with_bit_le(self, bit: u32) -> Selfwhere Self: Sized,

Set the given bit and return the modified set with the LittleEndian indexing.

Examples
use bittle::{Bits, BitsOwned};

let set = u128::zeros().with_bit_le(8).with_bit_le(12);
assert!(set.iter_ones_le().eq([8, 12]))

Using a larger set:

use bittle::{Bits, BitsOwned};

let set = <[u32; 4]>::zeros().with_bit_le(8).with_bit_le(12);
assert!(set.iter_ones_le().eq([8, 12]))
source

fn with_bit_be(self, bit: u32) -> Selfwhere Self: Sized,

Set the given bit and return the modified set with the BigEndian indexing.

Examples
use bittle::{Bits, BitsOwned};

let set = u128::zeros().with_bit_be(8).with_bit_be(12);
assert!(set.iter_ones_be().eq([8, 12]))

Using a larger set:

use bittle::{Bits, BitsOwned};

let set = <[u32; 4]>::zeros().with_bit_be(8).with_bit_be(12);
assert!(set.iter_ones_be().eq([8, 12]))
source

fn without_bit_le(self, bit: u32) -> Selfwhere Self: Sized,

Set the given bit and return the modified set using LittleEndian indexing.

Examples
use bittle::{Bits, BitsOwned};

let set = u8::ones().without_bit_le(2);
assert!(set.iter_ones_le().eq([0, 1, 3, 4, 5, 6, 7]))

Using a larger set:

use bittle::{Bits, BitsOwned};

let set = <[u8; 2]>::ones().without_bit_le(2).without_bit_le(10);
assert!(set.iter_ones_le().eq([0, 1, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15]))
source

fn without_bit_be(self, bit: u32) -> Selfwhere Self: Sized,

Set the given bit and return the modified set using BigEndian indexing.

Examples
use bittle::{Bits, BitsOwned};

let set = u8::ones().without_bit_be(2);
assert!(set.iter_ones_be().eq([0, 1, 3, 4, 5, 6, 7]))

Using a larger set:

use bittle::{Bits, BitsOwned};

let set = <[u8; 2]>::ones().without_bit_be(2).without_bit_be(10);
assert!(set.iter_ones_be().eq([0, 1, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15]))
source

fn into_iter_ones_le(self) -> Self::IntoIterOnesIn<LittleEndian>where Self: Sized,

Construct an owning iterator over all ones in a set using LittleEndian indexing.

Will iterate through elements from smallest to largest index.

Examples
use bittle::{Bits, BitsOwned};

let a: u128 = bittle::set_le![3, 7];
assert!(a.into_iter_ones_le().eq([3, 7]));

Using a larger set:

use bittle::{Bits, BitsOwned};

let a: [u32; 4] = bittle::set_le![4, 63, 71];
assert!(a.into_iter_ones_le().eq([4, 63, 71]));
source

fn into_iter_ones_be(self) -> Self::IntoIterOnesIn<BigEndian>where Self: Sized,

Construct an owning iterator over all ones in a set using BigEndian indexing.

Will iterate through elements from smallest to largest index.

Examples
use bittle::{Bits, BitsOwned};

let a: u128 = bittle::set![3, 7];
assert!(a.into_iter_ones_be().eq([3, 7]));

Using a larger set:

use bittle::{Bits, BitsOwned};

let a: [u32; 4] = bittle::set![4, 63, 71];
assert!(a.into_iter_ones_be().eq([4, 63, 71]));
source

fn into_iter_zeros_le(self) -> Self::IntoIterZerosIn<LittleEndian>where Self: Sized,

Construct an owning iterator over all zeros in a set using LittleEndian indexing.

Will iterate through elements from smallest to largest index.

Examples
use bittle::{Bits, BitsOwned};

let a: u16 = bittle::set_le![4, 7, 10];
assert!(a.into_iter_zeros_le().eq([0, 1, 2, 3, 5, 6, 8, 9, 11, 12, 13, 14, 15]));

Using a larger set:

use bittle::{Bits, BitsOwned};

let a: [u8; 2] = bittle::set_le![4, 7, 10];
assert!(a.into_iter_zeros_le().eq([0, 1, 2, 3, 5, 6, 8, 9, 11, 12, 13, 14, 15]));
source

fn into_iter_zeros_be(self) -> Self::IntoIterZerosIn<BigEndian>where Self: Sized,

Construct an owning iterator over all zeros in a set using BigEndian indexing.

Will iterate through elements from smallest to largest index.

Examples
use bittle::{Bits, BitsOwned};

let a: u16 = bittle::set![4, 7, 10];
assert!(a.into_iter_zeros_be().eq([0, 1, 2, 3, 5, 6, 8, 9, 11, 12, 13, 14, 15]));

Using a larger set:

use bittle::{Bits, BitsOwned};

let a: [u8; 2] = bittle::set![4, 7, 10];
assert!(a.into_iter_zeros_be().eq([0, 1, 2, 3, 5, 6, 8, 9, 11, 12, 13, 14, 15]));

Implementations on Foreign Types§

source§

impl<T, const N: usize> BitsOwned for [T; N]where T: Eq + BitsOwned,

source§

const BITS: u32 = _

source§

const ZEROS: Self = _

source§

const ONES: Self = _

§

type IntoIterOnes = IntoIterOnes<T, N, BigEndian>

§

type IntoIterOnesIn<E> where E: Endian = IntoIterOnes<T, N, E>

§

type IntoIterZeros = IntoIterZeros<T, N, BigEndian>

§

type IntoIterZerosIn<E> where E: Endian = IntoIterZeros<T, N, E>

source§

fn zeros() -> Self

source§

fn ones() -> Self

source§

fn with_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn with_bit(self, bit: u32) -> Self

source§

fn without_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn without_bit(self, bit: u32) -> Self

source§

fn union(self, other: Self) -> Self

source§

fn conjunction(self, other: Self) -> Self

source§

fn difference(self, other: Self) -> Self

source§

fn symmetric_difference(self, other: Self) -> Self

source§

fn into_iter_ones(self) -> Self::IntoIterOnes

source§

fn into_iter_ones_in<E>(self) -> Self::IntoIterOnesIn<E>where E: Endian,

source§

fn into_iter_zeros(self) -> Self::IntoIterZeros

source§

fn into_iter_zeros_in<E>(self) -> Self::IntoIterZerosIn<E>where E: Endian,

source§

impl BitsOwned for u64

source§

const BITS: u32 = 64u32

source§

const ZEROS: Self = 0u64

source§

const ONES: Self = 18_446_744_073_709_551_615u64

§

type IntoIterOnes = IterOnes<u64, BigEndian>

§

type IntoIterOnesIn<E> where E: Endian = IterOnes<u64, E>

§

type IntoIterZeros = IterZeros<u64, BigEndian>

§

type IntoIterZerosIn<E> where E: Endian = IterZeros<u64, E>

source§

fn zeros() -> Self

source§

fn ones() -> Self

source§

fn with_bit(self, bit: u32) -> Self

source§

fn with_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn without_bit(self, bit: u32) -> Self

source§

fn without_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn union(self, other: Self) -> Self

source§

fn conjunction(self, other: Self) -> Self

source§

fn difference(self, other: Self) -> Self

source§

fn symmetric_difference(self, other: Self) -> Self

source§

fn into_iter_ones(self) -> Self::IntoIterOnes

source§

fn into_iter_ones_in<E>(self) -> Self::IntoIterOnesIn<E>where E: Endian,

source§

fn into_iter_zeros(self) -> Self::IntoIterZeros

source§

fn into_iter_zeros_in<E>(self) -> Self::IntoIterZerosIn<E>where E: Endian,

source§

impl BitsOwned for u8

source§

const BITS: u32 = 8u32

source§

const ZEROS: Self = 0u8

source§

const ONES: Self = 255u8

§

type IntoIterOnes = IterOnes<u8, BigEndian>

§

type IntoIterOnesIn<E> where E: Endian = IterOnes<u8, E>

§

type IntoIterZeros = IterZeros<u8, BigEndian>

§

type IntoIterZerosIn<E> where E: Endian = IterZeros<u8, E>

source§

fn zeros() -> Self

source§

fn ones() -> Self

source§

fn with_bit(self, bit: u32) -> Self

source§

fn with_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn without_bit(self, bit: u32) -> Self

source§

fn without_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn union(self, other: Self) -> Self

source§

fn conjunction(self, other: Self) -> Self

source§

fn difference(self, other: Self) -> Self

source§

fn symmetric_difference(self, other: Self) -> Self

source§

fn into_iter_ones(self) -> Self::IntoIterOnes

source§

fn into_iter_ones_in<E>(self) -> Self::IntoIterOnesIn<E>where E: Endian,

source§

fn into_iter_zeros(self) -> Self::IntoIterZeros

source§

fn into_iter_zeros_in<E>(self) -> Self::IntoIterZerosIn<E>where E: Endian,

source§

impl BitsOwned for u16

source§

const BITS: u32 = 16u32

source§

const ZEROS: Self = 0u16

source§

const ONES: Self = 65_535u16

§

type IntoIterOnes = IterOnes<u16, BigEndian>

§

type IntoIterOnesIn<E> where E: Endian = IterOnes<u16, E>

§

type IntoIterZeros = IterZeros<u16, BigEndian>

§

type IntoIterZerosIn<E> where E: Endian = IterZeros<u16, E>

source§

fn zeros() -> Self

source§

fn ones() -> Self

source§

fn with_bit(self, bit: u32) -> Self

source§

fn with_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn without_bit(self, bit: u32) -> Self

source§

fn without_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn union(self, other: Self) -> Self

source§

fn conjunction(self, other: Self) -> Self

source§

fn difference(self, other: Self) -> Self

source§

fn symmetric_difference(self, other: Self) -> Self

source§

fn into_iter_ones(self) -> Self::IntoIterOnes

source§

fn into_iter_ones_in<E>(self) -> Self::IntoIterOnesIn<E>where E: Endian,

source§

fn into_iter_zeros(self) -> Self::IntoIterZeros

source§

fn into_iter_zeros_in<E>(self) -> Self::IntoIterZerosIn<E>where E: Endian,

source§

impl BitsOwned for usize

source§

const BITS: u32 = 64u32

source§

const ZEROS: Self = 0usize

source§

const ONES: Self = 18_446_744_073_709_551_615usize

§

type IntoIterOnes = IterOnes<usize, BigEndian>

§

type IntoIterOnesIn<E> where E: Endian = IterOnes<usize, E>

§

type IntoIterZeros = IterZeros<usize, BigEndian>

§

type IntoIterZerosIn<E> where E: Endian = IterZeros<usize, E>

source§

fn zeros() -> Self

source§

fn ones() -> Self

source§

fn with_bit(self, bit: u32) -> Self

source§

fn with_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn without_bit(self, bit: u32) -> Self

source§

fn without_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn union(self, other: Self) -> Self

source§

fn conjunction(self, other: Self) -> Self

source§

fn difference(self, other: Self) -> Self

source§

fn symmetric_difference(self, other: Self) -> Self

source§

fn into_iter_ones(self) -> Self::IntoIterOnes

source§

fn into_iter_ones_in<E>(self) -> Self::IntoIterOnesIn<E>where E: Endian,

source§

fn into_iter_zeros(self) -> Self::IntoIterZeros

source§

fn into_iter_zeros_in<E>(self) -> Self::IntoIterZerosIn<E>where E: Endian,

source§

impl BitsOwned for i32

source§

const BITS: u32 = 32u32

source§

const ZEROS: Self = 0i32

source§

const ONES: Self = -1i32

§

type IntoIterOnes = IterOnes<i32, BigEndian>

§

type IntoIterOnesIn<E> where E: Endian = IterOnes<i32, E>

§

type IntoIterZeros = IterZeros<i32, BigEndian>

§

type IntoIterZerosIn<E> where E: Endian = IterZeros<i32, E>

source§

fn zeros() -> Self

source§

fn ones() -> Self

source§

fn with_bit(self, bit: u32) -> Self

source§

fn with_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn without_bit(self, bit: u32) -> Self

source§

fn without_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn union(self, other: Self) -> Self

source§

fn conjunction(self, other: Self) -> Self

source§

fn difference(self, other: Self) -> Self

source§

fn symmetric_difference(self, other: Self) -> Self

source§

fn into_iter_ones(self) -> Self::IntoIterOnes

source§

fn into_iter_ones_in<E>(self) -> Self::IntoIterOnesIn<E>where E: Endian,

source§

fn into_iter_zeros(self) -> Self::IntoIterZeros

source§

fn into_iter_zeros_in<E>(self) -> Self::IntoIterZerosIn<E>where E: Endian,

source§

impl BitsOwned for i16

source§

const BITS: u32 = 16u32

source§

const ZEROS: Self = 0i16

source§

const ONES: Self = -1i16

§

type IntoIterOnes = IterOnes<i16, BigEndian>

§

type IntoIterOnesIn<E> where E: Endian = IterOnes<i16, E>

§

type IntoIterZeros = IterZeros<i16, BigEndian>

§

type IntoIterZerosIn<E> where E: Endian = IterZeros<i16, E>

source§

fn zeros() -> Self

source§

fn ones() -> Self

source§

fn with_bit(self, bit: u32) -> Self

source§

fn with_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn without_bit(self, bit: u32) -> Self

source§

fn without_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn union(self, other: Self) -> Self

source§

fn conjunction(self, other: Self) -> Self

source§

fn difference(self, other: Self) -> Self

source§

fn symmetric_difference(self, other: Self) -> Self

source§

fn into_iter_ones(self) -> Self::IntoIterOnes

source§

fn into_iter_ones_in<E>(self) -> Self::IntoIterOnesIn<E>where E: Endian,

source§

fn into_iter_zeros(self) -> Self::IntoIterZeros

source§

fn into_iter_zeros_in<E>(self) -> Self::IntoIterZerosIn<E>where E: Endian,

source§

impl BitsOwned for i8

source§

const BITS: u32 = 8u32

source§

const ZEROS: Self = 0i8

source§

const ONES: Self = -1i8

§

type IntoIterOnes = IterOnes<i8, BigEndian>

§

type IntoIterOnesIn<E> where E: Endian = IterOnes<i8, E>

§

type IntoIterZeros = IterZeros<i8, BigEndian>

§

type IntoIterZerosIn<E> where E: Endian = IterZeros<i8, E>

source§

fn zeros() -> Self

source§

fn ones() -> Self

source§

fn with_bit(self, bit: u32) -> Self

source§

fn with_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn without_bit(self, bit: u32) -> Self

source§

fn without_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn union(self, other: Self) -> Self

source§

fn conjunction(self, other: Self) -> Self

source§

fn difference(self, other: Self) -> Self

source§

fn symmetric_difference(self, other: Self) -> Self

source§

fn into_iter_ones(self) -> Self::IntoIterOnes

source§

fn into_iter_ones_in<E>(self) -> Self::IntoIterOnesIn<E>where E: Endian,

source§

fn into_iter_zeros(self) -> Self::IntoIterZeros

source§

fn into_iter_zeros_in<E>(self) -> Self::IntoIterZerosIn<E>where E: Endian,

source§

impl BitsOwned for u128

source§

const BITS: u32 = 128u32

source§

const ZEROS: Self = 0u128

source§

const ONES: Self = 340_282_366_920_938_463_463_374_607_431_768_211_455u128

§

type IntoIterOnes = IterOnes<u128, BigEndian>

§

type IntoIterOnesIn<E> where E: Endian = IterOnes<u128, E>

§

type IntoIterZeros = IterZeros<u128, BigEndian>

§

type IntoIterZerosIn<E> where E: Endian = IterZeros<u128, E>

source§

fn zeros() -> Self

source§

fn ones() -> Self

source§

fn with_bit(self, bit: u32) -> Self

source§

fn with_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn without_bit(self, bit: u32) -> Self

source§

fn without_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn union(self, other: Self) -> Self

source§

fn conjunction(self, other: Self) -> Self

source§

fn difference(self, other: Self) -> Self

source§

fn symmetric_difference(self, other: Self) -> Self

source§

fn into_iter_ones(self) -> Self::IntoIterOnes

source§

fn into_iter_ones_in<E>(self) -> Self::IntoIterOnesIn<E>where E: Endian,

source§

fn into_iter_zeros(self) -> Self::IntoIterZeros

source§

fn into_iter_zeros_in<E>(self) -> Self::IntoIterZerosIn<E>where E: Endian,

source§

impl BitsOwned for i64

source§

const BITS: u32 = 64u32

source§

const ZEROS: Self = 0i64

source§

const ONES: Self = -1i64

§

type IntoIterOnes = IterOnes<i64, BigEndian>

§

type IntoIterOnesIn<E> where E: Endian = IterOnes<i64, E>

§

type IntoIterZeros = IterZeros<i64, BigEndian>

§

type IntoIterZerosIn<E> where E: Endian = IterZeros<i64, E>

source§

fn zeros() -> Self

source§

fn ones() -> Self

source§

fn with_bit(self, bit: u32) -> Self

source§

fn with_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn without_bit(self, bit: u32) -> Self

source§

fn without_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn union(self, other: Self) -> Self

source§

fn conjunction(self, other: Self) -> Self

source§

fn difference(self, other: Self) -> Self

source§

fn symmetric_difference(self, other: Self) -> Self

source§

fn into_iter_ones(self) -> Self::IntoIterOnes

source§

fn into_iter_ones_in<E>(self) -> Self::IntoIterOnesIn<E>where E: Endian,

source§

fn into_iter_zeros(self) -> Self::IntoIterZeros

source§

fn into_iter_zeros_in<E>(self) -> Self::IntoIterZerosIn<E>where E: Endian,

source§

impl BitsOwned for i128

source§

const BITS: u32 = 128u32

source§

const ZEROS: Self = 0i128

source§

const ONES: Self = -1i128

§

type IntoIterOnes = IterOnes<i128, BigEndian>

§

type IntoIterOnesIn<E> where E: Endian = IterOnes<i128, E>

§

type IntoIterZeros = IterZeros<i128, BigEndian>

§

type IntoIterZerosIn<E> where E: Endian = IterZeros<i128, E>

source§

fn zeros() -> Self

source§

fn ones() -> Self

source§

fn with_bit(self, bit: u32) -> Self

source§

fn with_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn without_bit(self, bit: u32) -> Self

source§

fn without_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn union(self, other: Self) -> Self

source§

fn conjunction(self, other: Self) -> Self

source§

fn difference(self, other: Self) -> Self

source§

fn symmetric_difference(self, other: Self) -> Self

source§

fn into_iter_ones(self) -> Self::IntoIterOnes

source§

fn into_iter_ones_in<E>(self) -> Self::IntoIterOnesIn<E>where E: Endian,

source§

fn into_iter_zeros(self) -> Self::IntoIterZeros

source§

fn into_iter_zeros_in<E>(self) -> Self::IntoIterZerosIn<E>where E: Endian,

source§

impl BitsOwned for isize

source§

const BITS: u32 = 64u32

source§

const ZEROS: Self = 0isize

source§

const ONES: Self = -1isize

§

type IntoIterOnes = IterOnes<isize, BigEndian>

§

type IntoIterOnesIn<E> where E: Endian = IterOnes<isize, E>

§

type IntoIterZeros = IterZeros<isize, BigEndian>

§

type IntoIterZerosIn<E> where E: Endian = IterZeros<isize, E>

source§

fn zeros() -> Self

source§

fn ones() -> Self

source§

fn with_bit(self, bit: u32) -> Self

source§

fn with_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn without_bit(self, bit: u32) -> Self

source§

fn without_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn union(self, other: Self) -> Self

source§

fn conjunction(self, other: Self) -> Self

source§

fn difference(self, other: Self) -> Self

source§

fn symmetric_difference(self, other: Self) -> Self

source§

fn into_iter_ones(self) -> Self::IntoIterOnes

source§

fn into_iter_ones_in<E>(self) -> Self::IntoIterOnesIn<E>where E: Endian,

source§

fn into_iter_zeros(self) -> Self::IntoIterZeros

source§

fn into_iter_zeros_in<E>(self) -> Self::IntoIterZerosIn<E>where E: Endian,

source§

impl BitsOwned for u32

source§

const BITS: u32 = 32u32

source§

const ZEROS: Self = 0u32

source§

const ONES: Self = 4_294_967_295u32

§

type IntoIterOnes = IterOnes<u32, BigEndian>

§

type IntoIterOnesIn<E> where E: Endian = IterOnes<u32, E>

§

type IntoIterZeros = IterZeros<u32, BigEndian>

§

type IntoIterZerosIn<E> where E: Endian = IterZeros<u32, E>

source§

fn zeros() -> Self

source§

fn ones() -> Self

source§

fn with_bit(self, bit: u32) -> Self

source§

fn with_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn without_bit(self, bit: u32) -> Self

source§

fn without_bit_in<E>(self, bit: u32) -> Selfwhere E: Endian,

source§

fn union(self, other: Self) -> Self

source§

fn conjunction(self, other: Self) -> Self

source§

fn difference(self, other: Self) -> Self

source§

fn symmetric_difference(self, other: Self) -> Self

source§

fn into_iter_ones(self) -> Self::IntoIterOnes

source§

fn into_iter_ones_in<E>(self) -> Self::IntoIterOnesIn<E>where E: Endian,

source§

fn into_iter_zeros(self) -> Self::IntoIterZeros

source§

fn into_iter_zeros_in<E>(self) -> Self::IntoIterZerosIn<E>where E: Endian,

Implementors§

source§

impl<T, U> BitsOwned for Set<T, U>where T: BitsOwned, U: Endian,

source§

const BITS: u32 = T::BITS

source§

const ONES: Self = _

source§

const ZEROS: Self = _

§

type IntoIterOnes = <T as BitsOwned>::IntoIterOnesIn<U>

§

type IntoIterOnesIn<E> where E: Endian = <T as BitsOwned>::IntoIterOnesIn<E>

§

type IntoIterZeros = <T as BitsOwned>::IntoIterZerosIn<U>

§

type IntoIterZerosIn<E> where E: Endian = <T as BitsOwned>::IntoIterZerosIn<E>