Struct bv::BitSlice [] [src]

pub struct BitSlice<'a, Block> { /* fields omitted */ }

A slice of a bit-vector; akin to &'a [bool] but packed.

Methods

impl<'a, Block: BlockType> BitSlice<'a, Block>
[src]

[src]

Creates a BitSlice from a pointer to its data, an offset where the bits start, and the number of available bits.

This is unsafe because the size of the passed-in buffer is not checked. It must hold at least offset + len bits or the resulting behavior is undefined.

[src]

Creates a BitSlice from an array slice of blocks.

The size is always a multiple of Block::nbits(). If you want a different size, slice.

[src]

The number of bits in the slice.

[src]

Returns whether there are no bits in the slice.

Important traits for BitSliceBlockIter<'a, Block>
[src]

Gets an iterator over the blocks of the slice.

Note that this iterates over whole blocks, with a partial block only at the end. That means that if the bit-slice offset is non-zero, these blocks may not correspond to the blocks retrieved by BitVec::get_block.

Trait Implementations

impl<'a, Block: Copy> Copy for BitSlice<'a, Block>
[src]

impl<'a, Block: Clone> Clone for BitSlice<'a, Block>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<'a, Block: BlockType> BitVec for BitSlice<'a, Block>
[src]

The underlying block type used to store the bits of the vector.

[src]

The length of the slice in bits.

[src]

The number of bits into the first block that the bit vector starts. Must be less than Block::nbits(). Read more

[src]

Gets the block at position Read more

[src]

The length of the slice in blocks.

[src]

Gets the bit at position Read more

[src]

Gets count bits starting at bit index start, interpreted as a little-endian integer. Read more

impl<'a, Block: BlockType> Index<u64> for BitSlice<'a, Block>
[src]

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

impl<'a, Block: BlockType> BitSliceable<Range<u64>> for BitSlice<'a, Block>
[src]

The type of the slice.

[src]

(Re-)slices the given object.

impl<'a, Block: BlockType> BitSliceable<RangeFrom<u64>> for BitSlice<'a, Block>
[src]

The type of the slice.

[src]

(Re-)slices the given object.

impl<'a, Block: BlockType> BitSliceable<RangeTo<u64>> for BitSlice<'a, Block>
[src]

The type of the slice.

[src]

(Re-)slices the given object.

impl<'a, Block: BlockType> BitSliceable<RangeFull> for BitSlice<'a, Block>
[src]

The type of the slice.

[src]

(Re-)slices the given object.

impl<'a, Block: BlockType> PartialEq for BitSlice<'a, Block>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl<'a, Block: BlockType> Eq for BitSlice<'a, Block>
[src]

impl<'a, Block: BlockType> PartialOrd for BitSlice<'a, Block>
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<'a, Block: BlockType> Ord for BitSlice<'a, Block>
[src]

[src]

This method returns an Ordering between self and other. Read more

1.21.0
[src]

Compares and returns the maximum of two values. Read more

1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl<'a, Block: BlockType + Hash> Hash for BitSlice<'a, Block>
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<'a, Block: BlockType> Debug for BitSlice<'a, Block>
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<'a, Block> !Send for BitSlice<'a, Block>

impl<'a, Block> !Sync for BitSlice<'a, Block>