pub struct U32(/* private fields */);Expand description
A subtype of Value that represents a specific integer variant
ranging from 8 to 64 bits, signed or unsigned
32 bit unsigned integer
Implementations§
Source§impl U32
impl U32
Sourcepub fn unsized_bitwise_not(&self) -> Self
pub fn unsized_bitwise_not(&self) -> Self
Bitwise NOT that attempts to remove the effect of the size of the integer:
!1u8 == 0u8 instead of !1u8 == 254u8
Sourcepub fn logical_lshift(&self, right: i32) -> Result<Self, Error>
pub fn logical_lshift(&self, right: i32) -> Result<Self, Error>
Shift that always ignores the msb
Sourcepub fn logical_rshift(&self, right: i32) -> Result<Self, Error>
pub fn logical_rshift(&self, right: i32) -> Result<Self, Error>
Shift that always ignores the msb
Sourcepub fn arithmetic_lshift(&self, right: i32) -> Result<Self, Error>
pub fn arithmetic_lshift(&self, right: i32) -> Result<Self, Error>
Shift that always preserves the msb
Sourcepub fn arithmetic_rshift(&self, right: i32) -> Result<Self, Error>
pub fn arithmetic_rshift(&self, right: i32) -> Result<Self, Error>
Shift that always preserves the msb
Sourcepub fn from_str_radix(s: &str) -> Result<Self, Error>
pub fn from_str_radix(s: &str) -> Result<Self, Error>
Creates a new integer from a string representation of a base-n number
The string must be in the form of 0b<binary>, 0o<octal>, 0x<hex>, or 0<octal>
Trait Implementations§
Source§impl ArithmeticOperationExt for U32
impl ArithmeticOperationExt for U32
Source§fn arithmetic_op(
self,
right: Self,
operation: ArithmeticOperation,
) -> Result<Self, Error>
fn arithmetic_op( self, right: Self, operation: ArithmeticOperation, ) -> Result<Self, Error>
Perform an arithmetic operation on two values
If the operation is not supported on the given type,
an
Error::UnsupportedOperation will be returned Read moreSource§impl BitwiseOperationExt for U32
impl BitwiseOperationExt for U32
Source§fn bitwise_op(
self,
right: Self,
operation: BitwiseOperation,
) -> Result<Self, Error>
fn bitwise_op( self, right: Self, operation: BitwiseOperation, ) -> Result<Self, Error>
Perform a bitwise operation on two values
If the operation is not supported on the given type,
an
Error::UnsupportedOperation will be returned Read moreSource§impl BooleanOperationExt for U32
impl BooleanOperationExt for U32
Source§fn boolean_op(
self,
right: Self,
operation: BooleanOperation,
) -> Result<Value, Error>
fn boolean_op( self, right: Self, operation: BooleanOperation, ) -> Result<Value, Error>
Perform a boolean operation on two values
If the operation is not supported on the given type,
an
Error::UnsupportedOperation will be returned Read moreSource§impl<'de> Deserialize<'de> for U32
impl<'de> Deserialize<'de> for U32
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for U32
impl Ord for U32
Source§impl PartialOrd for U32
impl PartialOrd for U32
Source§impl ValueTrait for U32
impl ValueTrait for U32
Source§fn into_inner(self) -> u32
fn into_inner(self) -> u32
Consumes the value and returns the inner value
impl Eq for U32
impl StructuralPartialEq for U32
Auto Trait Implementations§
impl Freeze for U32
impl RefUnwindSafe for U32
impl Send for U32
impl Sync for U32
impl Unpin for U32
impl UnwindSafe for U32
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more