pub struct I32(/* 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 signed integer
Implementations§
Source§impl I32
impl I32
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 I32
impl ArithmeticOperationExt for I32
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 I32
impl BitwiseOperationExt for I32
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 I32
impl BooleanOperationExt for I32
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 I32
impl<'de> Deserialize<'de> for I32
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 I32
impl Ord for I32
Source§impl PartialOrd for I32
impl PartialOrd for I32
Source§impl ValueTrait for I32
impl ValueTrait for I32
Source§fn into_inner(self) -> i32
fn into_inner(self) -> i32
Consumes the value and returns the inner value
impl Eq for I32
impl StructuralPartialEq for I32
Auto Trait Implementations§
impl Freeze for I32
impl RefUnwindSafe for I32
impl Send for I32
impl Sync for I32
impl Unpin for I32
impl UnwindSafe for I32
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