InsertIntoSizedIntegerTypes

Trait InsertIntoSizedIntegerTypes 

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

Provides a single function to insert a sized integer into an other sized integer type

Required Methods§

Source

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

Inserts a sized integer value into an other sized integer type Parameters:

  • bit offset (u32) the start position of the bits to be extracted. Zero is the most significant bit
  • length (u32) the number of bits to be extracted (at the least significant side).
  • value (Any sized integer type) the value to be inserted.

Implementations on Foreign Types§

Source§

impl InsertIntoSizedIntegerTypes for i8

Source§

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

Source§

impl InsertIntoSizedIntegerTypes for i16

Source§

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

Source§

impl InsertIntoSizedIntegerTypes for i32

Source§

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

Source§

impl InsertIntoSizedIntegerTypes for i64

Source§

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

Source§

impl InsertIntoSizedIntegerTypes for u8

Source§

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

Source§

impl InsertIntoSizedIntegerTypes for u16

Source§

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

Source§

impl InsertIntoSizedIntegerTypes for u32

Source§

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

Source§

impl InsertIntoSizedIntegerTypes for u64

Source§

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

Implementors§