pub struct U8(/* private fields */);
Expand description
A subtype of Value
that represents a specific integer variant
ranging from 8 to 64 bits, signed or unsigned
8 bit unsigned integer
Implementations§
Source§impl U8
impl U8
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 U8
impl ArithmeticOperationExt for U8
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 U8
impl BitwiseOperationExt for U8
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 U8
impl BooleanOperationExt for U8
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 U8
impl<'de> Deserialize<'de> for U8
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 U8
impl Ord for U8
Source§impl PartialOrd for U8
impl PartialOrd for U8
Source§impl ValueTrait for U8
impl ValueTrait for U8
Source§fn into_inner(self) -> u8
fn into_inner(self) -> u8
Consumes the value and returns the inner value
impl Eq for U8
impl StructuralPartialEq for U8
Auto Trait Implementations§
impl Freeze for U8
impl RefUnwindSafe for U8
impl Send for U8
impl Sync for U8
impl Unpin for U8
impl UnwindSafe for U8
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