Struct polyvalue::types::I32

source ·
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

source

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

source

pub fn logical_lshift(&self, right: i32) -> Result<Self, Error>

Shift that always ignores the msb

source

pub fn logical_rshift(&self, right: i32) -> Result<Self, Error>

Shift that always ignores the msb

source

pub fn arithmetic_lshift(&self, right: i32) -> Result<Self, Error>

Shift that always preserves the msb

source

pub fn arithmetic_rshift(&self, right: i32) -> Result<Self, Error>

Shift that always preserves the msb

source

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 Add for I32

§

type Output = Result<I32, Error>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
source§

impl ArithmeticOperationExt for I32

source§

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 more
source§

fn arithmetic_neg(self) -> Result<Self, Error>
where Self: Sized,

Perform an arithmetic negation on a value This is equivalent to arithmetic_op with ArithmeticOperation::Negate but is provided for convenience Read more
source§

impl BitAnd for I32

§

type Output = Result<I32, Error>

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: Self) -> Self::Output

Performs the & operation. Read more
source§

impl BitOr for I32

§

type Output = Result<I32, Error>

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
source§

impl BitXor for I32

§

type Output = Result<I32, Error>

The resulting type after applying the ^ operator.
source§

fn bitxor(self, rhs: Self) -> Self::Output

Performs the ^ operation. Read more
source§

impl BitwiseOperationExt for I32

source§

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 more
source§

fn bitwise_not(self) -> Result<Self, Error>
where Self: Sized,

Perform a bitwise not on a value This is equivalent to bitwise_op with BitwiseOperation::Not but is provided for convenience Read more
source§

impl BooleanOperationExt for I32

source§

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 more
source§

fn boolean_not(self) -> Result<Value, Error>
where Self: Sized,

Perform a boolean not on a value This is equivalent to boolean_op with BooleanOperation::Not but is provided for convenience Read more
source§

impl Clone for I32

source§

fn clone(&self) -> I32

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for I32

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for I32

source§

fn default() -> I32

Returns the “default value” for a type. Read more
source§

impl DerefMut for I32

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<'de> Deserialize<'de> for I32

source§

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 Display for I32

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Div for I32

§

type Output = Result<I32, Error>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
source§

impl From<I32> for Value

source§

fn from(v: I32) -> Self

Converts to this type from the input type.
source§

impl From<i32> for I32

source§

fn from(value: i32) -> Self

Converts to this type from the input type.
source§

impl FromStr for I32

§

type Err = Error

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl Hash for I32

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Into<i32> for I32

source§

fn into(self) -> i32

Converts this type into the (usually inferred) input type.
source§

impl Mul for I32

§

type Output = Result<I32, Error>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
source§

impl Neg for I32

§

type Output = Result<I32, Error>

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl Ord for I32

source§

fn cmp(&self, other: &I32) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for I32

source§

fn eq(&self, other: &I32) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for I32

source§

fn partial_cmp(&self, other: &I32) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Rem for I32

§

type Output = Result<I32, Error>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: Self) -> Self::Output

Performs the % operation. Read more
source§

impl Serialize for I32

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Shl for I32

§

type Output = Result<I32, Error>

The resulting type after applying the << operator.
source§

fn shl(self, rhs: Self) -> Self::Output

Performs the << operation. Read more
source§

impl Shr for I32

§

type Output = Result<I32, Error>

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: Self) -> Self::Output

Performs the >> operation. Read more
source§

impl Sub for I32

§

type Output = Result<I32, Error>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
source§

impl TryFrom<Array> for I32

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: Array) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Bool> for I32

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: Bool) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Currency> for I32

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: Currency) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Fixed> for I32

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: Fixed) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Float> for I32

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: Float) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<I16> for I32

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: I16) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<I32> for Array

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: I32) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<I32> for Bool

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: I32) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<I32> for Currency

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: I32) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<I32> for Fixed

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: I32) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<I32> for Float

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: I32) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<I32> for I16

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: I32) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<I32> for I64

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: I32) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<I32> for I8

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: I32) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<I32> for Object

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: I32) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<I32> for Range

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: I32) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<I32> for Str

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: I32) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<I32> for U16

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: I32) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<I32> for U32

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: I32) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<I32> for U64

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: I32) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<I32> for U8

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: I32) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<I64> for I32

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: I64) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<I8> for I32

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: I8) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Object> for I32

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: Object) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Range> for I32

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: Range) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Str> for I32

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: Str) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<U16> for I32

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: U16) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<U32> for I32

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: U32) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<U64> for I32

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: U64) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<U8> for I32

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: U8) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for I32

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl ValueTrait for I32

§

type Inner = i32

The inner type of the value
source§

fn new(inner: i32) -> Self

Creates a new value from the given inner value
source§

fn inner(&self) -> &i32

Returns a reference to the inner value
source§

fn inner_mut(&mut self) -> &mut i32

Returns a mutable reference to the inner value
source§

fn into_inner(self) -> i32

Consumes the value and returns the inner value
source§

impl Deref for I32

§

type Target = <I32 as ValueTrait>::Inner

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Eq for I32

source§

impl StructuralPartialEq for I32

Auto Trait Implementations§

§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,