InsertBitsIntoVecU8

Trait InsertBitsIntoVecU8 

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

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§

Source

fn set<T>( &mut self, byte_offset: u32, bit_offset: u32, length: u32, value: T, ) -> Result<(), String>

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.

Implementations on Foreign Types§

Source§

impl InsertBitsIntoVecU8 for Vec<u8>

Source§

fn set<T>( &mut self, byte_offset: u32, bit_offset: u32, length: u32, value: T, ) -> Result<(), String>

Implementors§