[−][src]Struct bv::adapter::BitSliceAdapter
An adapter that turns any implementation of Bits
into a slice.
This is likely less efficient than BitSlice
.
Methods
impl<T: Bits> BitSliceAdapter<T>
[src]
pub fn new(bits: T, start: u64, len: u64) -> Self
[src]
Creates a new slice adaptor from the given bit-vector-like.
Takes the index of the start bit, and the length to slice.
Panics
Out of bounds if start + len > bits.bit_len()
.
Trait Implementations
impl<T: Bits> Bits for BitSliceAdapter<T>
[src]
type Block = T::Block
The underlying block type used to store the bits of the vector.
fn bit_len(&self) -> u64
[src]
fn get_bit(&self, position: u64) -> bool
[src]
fn get_block(&self, position: usize) -> Self::Block
[src]
fn get_bits(&self, start: u64, count: usize) -> Self::Block
[src]
fn block_len(&self) -> usize
[src]
fn get_raw_block(&self, position: usize) -> Self::Block
[src]
fn to_bit_vec(&self) -> BitVec<Self::Block>
[src]
impl<T: BitsMut> BitsMut for BitSliceAdapter<T>
[src]
fn set_bit(&mut self, position: u64, value: bool)
[src]
fn set_block(&mut self, position: usize, value: Self::Block)
[src]
fn set_bits(&mut self, start: u64, count: usize, value: Self::Block)
[src]
impl<T: Bits> BitSliceable<Range<u64>> for BitSliceAdapter<T>
[src]
type Slice = Self
The type of the slice produced.
fn bit_slice(self, range: Range<u64>) -> Self::Slice
[src]
impl<T: Bits> BitSliceable<RangeTo<u64>> for BitSliceAdapter<T>
[src]
type Slice = Self
The type of the slice produced.
fn bit_slice(self, range: RangeTo<u64>) -> Self::Slice
[src]
impl<T: Bits> BitSliceable<RangeFrom<u64>> for BitSliceAdapter<T>
[src]
type Slice = Self
The type of the slice produced.
fn bit_slice(self, range: RangeFrom<u64>) -> Self::Slice
[src]
impl<T: Bits> BitSliceable<RangeFull> for BitSliceAdapter<T>
[src]
type Slice = Self
The type of the slice produced.
fn bit_slice(self, _range: RangeFull) -> Self::Slice
[src]
impl<T: Bits> BitSliceable<RangeInclusive<u64>> for BitSliceAdapter<T>
[src]
type Slice = Self
The type of the slice produced.
fn bit_slice(self, range: RangeInclusive<u64>) -> Self::Slice
[src]
impl<T: Bits> BitSliceable<RangeToInclusive<u64>> for BitSliceAdapter<T>
[src]
type Slice = Self
The type of the slice produced.
fn bit_slice(self, range: RangeToInclusive<u64>) -> Self::Slice
[src]
impl<'a, T: Bits> BitSliceable<Range<u64>> for &'a BitSliceAdapter<T>
[src]
type Slice = BitSliceAdapter<&'a T>
The type of the slice produced.
fn bit_slice(self, range: Range<u64>) -> Self::Slice
[src]
impl<'a, T: Bits> BitSliceable<RangeTo<u64>> for &'a BitSliceAdapter<T>
[src]
type Slice = BitSliceAdapter<&'a T>
The type of the slice produced.
fn bit_slice(self, range: RangeTo<u64>) -> Self::Slice
[src]
impl<'a, T: Bits> BitSliceable<RangeFrom<u64>> for &'a BitSliceAdapter<T>
[src]
type Slice = BitSliceAdapter<&'a T>
The type of the slice produced.
fn bit_slice(self, range: RangeFrom<u64>) -> Self::Slice
[src]
impl<'a, T: Bits> BitSliceable<RangeFull> for &'a BitSliceAdapter<T>
[src]
type Slice = BitSliceAdapter<&'a T>
The type of the slice produced.
fn bit_slice(self, _range: RangeFull) -> Self::Slice
[src]
impl<'a, T: Bits> BitSliceable<RangeInclusive<u64>> for &'a BitSliceAdapter<T>
[src]
type Slice = BitSliceAdapter<&'a T>
The type of the slice produced.
fn bit_slice(self, range: RangeInclusive<u64>) -> Self::Slice
[src]
impl<'a, T: Bits> BitSliceable<RangeToInclusive<u64>> for &'a BitSliceAdapter<T>
[src]
type Slice = BitSliceAdapter<&'a T>
The type of the slice produced.
fn bit_slice(self, range: RangeToInclusive<u64>) -> Self::Slice
[src]
impl<T: Clone> Clone for BitSliceAdapter<T>
[src]
fn clone(&self) -> BitSliceAdapter<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Copy> Copy for BitSliceAdapter<T>
[src]
impl<T, U> PartialEq<U> for BitSliceAdapter<T> where
T: Bits,
U: Bits<Block = T::Block>,
[src]
T: Bits,
U: Bits<Block = T::Block>,
impl<T: Debug> Debug for BitSliceAdapter<T>
[src]
impl<T: Bits> Index<u64> for BitSliceAdapter<T>
[src]
Auto Trait Implementations
impl<T> Send for BitSliceAdapter<T> where
T: Send,
T: Send,
impl<T> Sync for BitSliceAdapter<T> where
T: Sync,
T: Sync,
impl<T> Unpin for BitSliceAdapter<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for BitSliceAdapter<T> where
T: UnwindSafe,
T: UnwindSafe,
impl<T> RefUnwindSafe for BitSliceAdapter<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,