# Trait bit_vec::BitBlock [−] [src]

    pub trait BitBlock: Copy + Add<Self, Output=Self> + Sub<Self, Output=Self> + Shl<usize, Output=Self> + Shr<usize, Output=Self> + Not<Output=Self> + BitAnd<Self, Output=Self> + BitOr<Self, Output=Self> + BitXor<Self, Output=Self> + Rem<Self, Output=Self> + Eq + Ord + Hash {
        fn bits() -> usize;
        fn from_byte(byte: u8) -> Self;
        fn count_ones(self) -> usize;
        fn zero() -> Self;
        fn one() -> Self;

        fn bytes() -> usize { ... }
    }

Abstracts over a pile of bits (basically unsigned primitives)

## Required Methods

### `fn bits() -> usize`

How many bits it has

### `fn from_byte(byte: u8) -> Self`

Convert a byte into this type (lowest-order bits set)

### `fn count_ones(self) -> usize`

Count the number of 1's in the bitwise repr

### `fn zero() -> Self`

Get `0`

### `fn one() -> Self`

Get `1`

## Provided Methods

### `fn bytes() -> usize`

How many bytes it has

## Implementors

- `impl BitBlock for u8`
- `impl BitBlock for u16`
- `impl BitBlock for u32`
- `impl BitBlock for u64`
- `impl BitBlock for usize`

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)