[][src]Trait bitlab::InsertIntoSizedIntegerTypes

pub trait InsertIntoSizedIntegerTypes {
    fn set<T>(
        self,
        bit_offset: u32,
        length: u32,
        value: T
    ) -> Result<Self, 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
; }

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

Required methods

fn set<T>(self, bit_offset: u32, length: u32, value: T) -> Result<Self, 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

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.
Loading content...

Implementations on Foreign Types

impl InsertIntoSizedIntegerTypes for u8[src]

impl InsertIntoSizedIntegerTypes for i8[src]

impl InsertIntoSizedIntegerTypes for u16[src]

impl InsertIntoSizedIntegerTypes for i16[src]

impl InsertIntoSizedIntegerTypes for u32[src]

impl InsertIntoSizedIntegerTypes for i32[src]

impl InsertIntoSizedIntegerTypes for u64[src]

impl InsertIntoSizedIntegerTypes for i64[src]

Loading content...

Implementors

Loading content...