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§
Sourcefn 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,
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,
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.