[][src]Trait bitlab::InsertBitsIntoVecU8

pub trait InsertBitsIntoVecU8 {
    fn set<T>(
        &mut self,
        byte_offset: u32,
        bit_offset: u32,
        length: u32,
        value: T
    ) -> Result<(), String>
    where
        Self: Sized,
        T: Sized,
        T: SignedInfo,
        T: AsPrimitive<u8>,
        T: AsPrimitive<i8>,
        T: AsPrimitive<u16>,
        T: AsPrimitive<i16>,
        T: AsPrimitive<u32>,
        T: AsPrimitive<i32>,
        T: AsPrimitive<u64>,
        T: AsPrimitive<i64>,
        T: ToString,
        T: SingleBits + Copy
; }

Defines a functions, which inserts a range of bits into a Vec Important: the contents of the vector are assumed to be big endian (network order)

Required methods

fn set<T>(
    &mut self,
    byte_offset: u32,
    bit_offset: u32,
    length: u32,
    value: T
) -> Result<(), String> where
    Self: Sized,
    T: Sized,
    T: SignedInfo,
    T: AsPrimitive<u8>,
    T: AsPrimitive<i8>,
    T: AsPrimitive<u16>,
    T: AsPrimitive<i16>,
    T: AsPrimitive<u32>,
    T: AsPrimitive<i32>,
    T: AsPrimitive<u64>,
    T: AsPrimitive<i64>,
    T: ToString,
    T: SingleBits + Copy

inserts a range of bits into a Vec

Parameters:

  • byte_offset (u32) the number of bytes to skip
  • bit_offset (u32) the number of bits to skip. Zero is the most significant bit
  • length (u32) the number of bits to be inserted.
  • value (u32) the value to be inserted.
Loading content...

Implementations on Foreign Types

impl InsertBitsIntoVecU8 for Vec<u8>[src]

Loading content...

Implementors

Loading content...