Struct i256
#[repr(C)]pub struct i256 {
low: u128,
high: i128,
}Expand description
A signed 256-bit integer
Fields§
§low: u128§high: i128Implementations§
§impl i256
impl i256
pub const fn from_le_bytes(b: [u8; 32]) -> i256
pub const fn from_le_bytes(b: [u8; 32]) -> i256
Create an integer value from its representation as a byte array in little-endian.
pub const fn from_be_bytes(b: [u8; 32]) -> i256
pub const fn from_be_bytes(b: [u8; 32]) -> i256
Create an integer value from its representation as a byte array in big-endian.
pub fn from_string(value_str: &str) -> Option<i256>
pub fn from_string(value_str: &str) -> Option<i256>
Create an integer value from its representation as string.
pub fn from_f64(v: f64) -> Option<i256>
pub fn from_f64(v: f64) -> Option<i256>
Create an optional i256 from the provided f64. Returning None
if overflow occurred
pub const fn from_parts(low: u128, high: i128) -> i256
pub const fn from_parts(low: u128, high: i128) -> i256
Create an i256 from the provided low u128 and high i128
pub fn to_i128(self) -> Option<i128>
pub fn to_i128(self) -> Option<i128>
Converts this i256 into an i128 returning None if this would result
in truncation/overflow
pub const fn to_le_bytes(self) -> [u8; 32]
pub const fn to_le_bytes(self) -> [u8; 32]
Return the memory representation of this integer as a byte array in little-endian byte order.
pub const fn to_be_bytes(self) -> [u8; 32]
pub const fn to_be_bytes(self) -> [u8; 32]
Return the memory representation of this integer as a byte array in big-endian byte order.
pub fn wrapping_abs(self) -> i256
pub fn wrapping_abs(self) -> i256
Computes the absolute value of this i256
pub fn checked_abs(self) -> Option<i256>
pub fn checked_abs(self) -> Option<i256>
Computes the absolute value of this i256 returning None if Self == Self::MIN
pub fn wrapping_neg(self) -> i256
pub fn wrapping_neg(self) -> i256
Negates this i256
pub fn checked_neg(self) -> Option<i256>
pub fn checked_neg(self) -> Option<i256>
Negates this i256 returning None if Self == Self::MIN
pub fn wrapping_add(self, other: i256) -> i256
pub fn wrapping_add(self, other: i256) -> i256
Performs wrapping addition
pub fn checked_add(self, other: i256) -> Option<i256>
pub fn checked_add(self, other: i256) -> Option<i256>
Performs checked addition
pub fn wrapping_sub(self, other: i256) -> i256
pub fn wrapping_sub(self, other: i256) -> i256
Performs wrapping subtraction
pub fn checked_sub(self, other: i256) -> Option<i256>
pub fn checked_sub(self, other: i256) -> Option<i256>
Performs checked subtraction
pub fn wrapping_mul(self, other: i256) -> i256
pub fn wrapping_mul(self, other: i256) -> i256
Performs wrapping multiplication
pub fn checked_mul(self, other: i256) -> Option<i256>
pub fn checked_mul(self, other: i256) -> Option<i256>
Performs checked multiplication
pub fn wrapping_div(self, other: i256) -> i256
pub fn wrapping_div(self, other: i256) -> i256
Performs wrapping division
pub fn checked_div(self, other: i256) -> Option<i256>
pub fn checked_div(self, other: i256) -> Option<i256>
Performs checked division
pub fn wrapping_rem(self, other: i256) -> i256
pub fn wrapping_rem(self, other: i256) -> i256
Performs wrapping remainder
pub fn checked_rem(self, other: i256) -> Option<i256>
pub fn checked_rem(self, other: i256) -> Option<i256>
Performs checked remainder
pub fn checked_pow(self, exp: u32) -> Option<i256>
pub fn checked_pow(self, exp: u32) -> Option<i256>
Performs checked exponentiation
pub fn wrapping_pow(self, exp: u32) -> i256
pub fn wrapping_pow(self, exp: u32) -> i256
Performs wrapping exponentiation
pub const fn is_negative(self) -> bool
pub const fn is_negative(self) -> bool
Returns true if this i256 is negative
pub const fn is_positive(self) -> bool
pub const fn is_positive(self) -> bool
Returns true if this i256 is positive
pub const fn leading_zeros(&self) -> u32
pub const fn leading_zeros(&self) -> u32
Returns the number of leading zeros in the binary representation of this i256.
pub const fn trailing_zeros(&self) -> u32
pub const fn trailing_zeros(&self) -> u32
Returns the number of trailing zeros in the binary representation of this i256.
Trait Implementations§
§impl ArrowNativeType for i256
impl ArrowNativeType for i256
§fn get_byte_width() -> usize
fn get_byte_width() -> usize
§impl ArrowNativeTypeOp for i256
impl ArrowNativeTypeOp for i256
§const MIN_TOTAL_ORDER: i256 = i256::MIN
const MIN_TOTAL_ORDER: i256 = i256::MIN
max aggregation.
Note that the aggregation uses the total order predicate for floating point values,
which means that this value is a negative NaN.§const MAX_TOTAL_ORDER: i256 = i256::MAX
const MAX_TOTAL_ORDER: i256 = i256::MAX
min aggregation.
Note that the aggregation uses the total order predicate for floating point values,
which means that this value is a positive NaN.§fn add_checked(self, rhs: i256) -> Result<i256, ArrowError>
fn add_checked(self, rhs: i256) -> Result<i256, ArrowError>
§fn add_wrapping(self, rhs: i256) -> i256
fn add_wrapping(self, rhs: i256) -> i256
§fn sub_checked(self, rhs: i256) -> Result<i256, ArrowError>
fn sub_checked(self, rhs: i256) -> Result<i256, ArrowError>
§fn sub_wrapping(self, rhs: i256) -> i256
fn sub_wrapping(self, rhs: i256) -> i256
§fn mul_checked(self, rhs: i256) -> Result<i256, ArrowError>
fn mul_checked(self, rhs: i256) -> Result<i256, ArrowError>
§fn mul_wrapping(self, rhs: i256) -> i256
fn mul_wrapping(self, rhs: i256) -> i256
§fn div_checked(self, rhs: i256) -> Result<i256, ArrowError>
fn div_checked(self, rhs: i256) -> Result<i256, ArrowError>
§fn div_wrapping(self, rhs: i256) -> i256
fn div_wrapping(self, rhs: i256) -> i256
§fn mod_checked(self, rhs: i256) -> Result<i256, ArrowError>
fn mod_checked(self, rhs: i256) -> Result<i256, ArrowError>
§fn mod_wrapping(self, rhs: i256) -> i256
fn mod_wrapping(self, rhs: i256) -> i256
§fn neg_checked(self) -> Result<i256, ArrowError>
fn neg_checked(self) -> Result<i256, ArrowError>
§fn pow_checked(self, exp: u32) -> Result<i256, ArrowError>
fn pow_checked(self, exp: u32) -> Result<i256, ArrowError>
§fn pow_wrapping(self, exp: u32) -> i256
fn pow_wrapping(self, exp: u32) -> i256
§fn neg_wrapping(self) -> i256
fn neg_wrapping(self) -> i256
§impl AsPrimitive<i256> for u32
impl AsPrimitive<i256> for u32
§impl CheckedAdd for i256
impl CheckedAdd for i256
§fn checked_add(&self, v: &i256) -> Option<i256>
fn checked_add(&self, v: &i256) -> Option<i256>
None is
returned.§impl CheckedDiv for i256
impl CheckedDiv for i256
§fn checked_div(&self, v: &i256) -> Option<i256>
fn checked_div(&self, v: &i256) -> Option<i256>
None is returned.§impl CheckedMul for i256
impl CheckedMul for i256
§fn checked_mul(&self, v: &i256) -> Option<i256>
fn checked_mul(&self, v: &i256) -> Option<i256>
None is returned.§impl CheckedNeg for i256
impl CheckedNeg for i256
§fn checked_neg(&self) -> Option<i256>
fn checked_neg(&self) -> Option<i256>
None for results that can’t be represented, like signed MIN
values that can’t be positive, or non-zero unsigned values that can’t be negative. Read more§impl CheckedRem for i256
impl CheckedRem for i256
§impl CheckedSub for i256
impl CheckedSub for i256
§fn checked_sub(&self, v: &i256) -> Option<i256>
fn checked_sub(&self, v: &i256) -> Option<i256>
None is returned.§impl DecimalCast for i256
impl DecimalCast for i256
§fn from_decimal<T>(n: T) -> Option<i256>where
T: DecimalCast,
fn from_decimal<T>(n: T) -> Option<i256>where
T: DecimalCast,
§impl From<i256> for NativeAdapter<Decimal256Type>
impl From<i256> for NativeAdapter<Decimal256Type>
§fn from(value: i256) -> NativeAdapter<Decimal256Type>
fn from(value: i256) -> NativeAdapter<Decimal256Type>
§impl Num for i256
impl Num for i256
type FromStrRadixErr = ParseI256Error
§fn from_str_radix(
str: &str,
radix: u32,
) -> Result<i256, <i256 as Num>::FromStrRadixErr>
fn from_str_radix( str: &str, radix: u32, ) -> Result<i256, <i256 as Num>::FromStrRadixErr>
2..=36). Read more§impl Ord for i256
impl Ord for i256
§impl PartialOrd for i256
impl PartialOrd for i256
§impl Signed for i256
impl Signed for i256
§fn is_positive(&self) -> bool
fn is_positive(&self) -> bool
§fn is_negative(&self) -> bool
fn is_negative(&self) -> bool
§impl ToPrimitive for i256
impl ToPrimitive for i256
§fn to_i64(&self) -> Option<i64>
fn to_i64(&self) -> Option<i64>
self to an i64. If the value cannot be
represented by an i64, then None is returned.§fn to_f64(&self) -> Option<f64>
fn to_f64(&self) -> Option<f64>
self to an f64. Overflows may map to positive
or negative inifinity, otherwise None is returned if the value cannot
be represented by an f64. Read more§fn to_u64(&self) -> Option<u64>
fn to_u64(&self) -> Option<u64>
self to a u64. If the value cannot be
represented by a u64, then None is returned.Source§fn to_isize(&self) -> Option<isize>
fn to_isize(&self) -> Option<isize>
self to an isize. If the value cannot be
represented by an isize, then None is returned.Source§fn to_i8(&self) -> Option<i8>
fn to_i8(&self) -> Option<i8>
self to an i8. If the value cannot be
represented by an i8, then None is returned.Source§fn to_i16(&self) -> Option<i16>
fn to_i16(&self) -> Option<i16>
self to an i16. If the value cannot be
represented by an i16, then None is returned.Source§fn to_i32(&self) -> Option<i32>
fn to_i32(&self) -> Option<i32>
self to an i32. If the value cannot be
represented by an i32, then None is returned.Source§fn to_i128(&self) -> Option<i128>
fn to_i128(&self) -> Option<i128>
self to an i128. If the value cannot be
represented by an i128 (i64 under the default implementation), then
None is returned. Read moreSource§fn to_usize(&self) -> Option<usize>
fn to_usize(&self) -> Option<usize>
self to a usize. If the value cannot be
represented by a usize, then None is returned.Source§fn to_u8(&self) -> Option<u8>
fn to_u8(&self) -> Option<u8>
self to a u8. If the value cannot be
represented by a u8, then None is returned.Source§fn to_u16(&self) -> Option<u16>
fn to_u16(&self) -> Option<u16>
self to a u16. If the value cannot be
represented by a u16, then None is returned.Source§fn to_u32(&self) -> Option<u32>
fn to_u32(&self) -> Option<u32>
self to a u32. If the value cannot be
represented by a u32, then None is returned.§impl WrappingAdd for i256
impl WrappingAdd for i256
§fn wrapping_add(&self, v: &i256) -> i256
fn wrapping_add(&self, v: &i256) -> i256
self + other, wrapping around at the boundary of
the type.§impl WrappingMul for i256
impl WrappingMul for i256
§fn wrapping_mul(&self, v: &i256) -> i256
fn wrapping_mul(&self, v: &i256) -> i256
self * other, wrapping around at the boundary
of the type.§impl WrappingNeg for i256
impl WrappingNeg for i256
§fn wrapping_neg(&self) -> i256
fn wrapping_neg(&self) -> i256
-self,
wrapping around at the boundary of the type. Read more§impl WrappingSub for i256
impl WrappingSub for i256
§fn wrapping_sub(&self, v: &i256) -> i256
fn wrapping_sub(&self, v: &i256) -> i256
self - other, wrapping around at the boundary
of the type.impl Copy for i256
impl Eq for i256
impl StructuralPartialEq for i256
Auto Trait Implementations§
impl Freeze for i256
impl RefUnwindSafe for i256
impl Send for i256
impl Sync for i256
impl Unpin for i256
impl UnwindSafe for i256
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<I> FromRadix10 for I
impl<I> FromRadix10 for I
§fn from_radix_10(text: &[u8]) -> (I, usize)
fn from_radix_10(text: &[u8]) -> (I, usize)
§impl<I> FromRadix10Checked for I
impl<I> FromRadix10Checked for I
§impl<I> FromRadix10Signed for I
impl<I> FromRadix10Signed for I
§fn from_radix_10_signed(text: &[u8]) -> (I, usize)
fn from_radix_10_signed(text: &[u8]) -> (I, usize)
§impl<I> FromRadix10SignedChecked for Iwhere
I: Zero + One + AddAssign + MulAssign + SubAssign + CheckedAdd + CheckedSub + CheckedMul + MaxNumDigits,
impl<I> FromRadix10SignedChecked for Iwhere
I: Zero + One + AddAssign + MulAssign + SubAssign + CheckedAdd + CheckedSub + CheckedMul + MaxNumDigits,
§impl<I> FromRadix16 for I
impl<I> FromRadix16 for I
§fn from_radix_16(text: &[u8]) -> (I, usize)
fn from_radix_16(text: &[u8]) -> (I, usize)
§impl<I> FromRadix16Checked for I
impl<I> FromRadix16Checked for I
Source§impl<T> LowerBounded for Twhere
T: Bounded,
impl<T> LowerBounded for Twhere
T: Bounded,
§impl<I> MaxNumDigits for I
impl<I> MaxNumDigits for I
§fn max_num_digits(radix: I) -> usize
fn max_num_digits(radix: I) -> usize
Returns the maximum number of digits a nonnegative representation of I can have depending
on radix.
§fn max_num_digits_negative(radix: I) -> usize
fn max_num_digits_negative(radix: I) -> usize
Returns the maximum number of digits a negative representation of I can have depending
on radix.