arrow::datatypes

Struct i256

#[repr(C)]
pub struct i256 { low: u128, high: i128, }
Expand description

A signed 256-bit integer

Fields§

§low: u128§high: i128

Implementations§

§

impl i256

pub const ZERO: i256 = _

The additive identity for this integer type, i.e. 0.

pub const ONE: i256 = _

The multiplicative identity for this integer type, i.e. 1.

pub const MINUS_ONE: i256 = _

The multiplicative inverse for this integer type, i.e. -1.

pub const MAX: i256 = _

The maximum value that can be represented by this integer type

pub const MIN: i256 = _

The minimum value that can be represented by this integer type

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

Create an integer value from its representation as a byte array in big-endian.

pub const fn from_i128(v: i128) -> i256

Create an i256 value from a 128-bit value.

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>

Create an optional i256 from the provided f64. Returning None if overflow occurred

pub const fn from_parts(low: u128, high: i128) -> i256

Create an i256 from the provided low u128 and high i128

pub const fn to_parts(self) -> (u128, i128)

Returns this i256 as a low u128 and high i128

pub fn to_i128(self) -> Option<i128>

Converts this i256 into an i128 returning None if this would result in truncation/overflow

pub fn as_i128(self) -> i128

Wraps this i256 into an i128

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]

Return the memory representation of this integer as a byte array in big-endian byte order.

pub fn wrapping_abs(self) -> i256

Computes the absolute value of this 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

Negates this 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

Performs wrapping addition

pub fn checked_add(self, other: i256) -> Option<i256>

Performs checked addition

pub fn wrapping_sub(self, other: i256) -> i256

Performs wrapping subtraction

pub fn checked_sub(self, other: i256) -> Option<i256>

Performs checked subtraction

pub fn wrapping_mul(self, other: i256) -> i256

Performs wrapping multiplication

pub fn checked_mul(self, other: i256) -> Option<i256>

Performs checked multiplication

pub fn wrapping_div(self, other: i256) -> i256

Performs wrapping division

pub fn checked_div(self, other: i256) -> Option<i256>

Performs checked division

pub fn wrapping_rem(self, other: i256) -> i256

Performs wrapping remainder

pub fn checked_rem(self, other: i256) -> Option<i256>

Performs checked remainder

pub fn checked_pow(self, exp: u32) -> Option<i256>

Performs checked exponentiation

pub fn wrapping_pow(self, exp: u32) -> i256

Performs wrapping exponentiation

pub const fn signum(self) -> i256

Returns a number i256 representing sign of this i256.

0 if the number is zero 1 if the number is positive -1 if the number is negative

pub const fn is_negative(self) -> bool

Returns true if this i256 is negative

pub const fn is_positive(self) -> bool

Returns true if this i256 is positive

Trait Implementations§

§

impl<'a, 'b> Add<&'b i256> for &'a i256

§

type Output = i256

The resulting type after applying the + operator.
§

fn add(self, rhs: &'b i256) -> <&'a i256 as Add<&'b i256>>::Output

Performs the + operation. Read more
§

impl<'a> Add<&'a i256> for i256

§

type Output = i256

The resulting type after applying the + operator.
§

fn add(self, rhs: &'a i256) -> <i256 as Add<&'a i256>>::Output

Performs the + operation. Read more
§

impl<'a> Add<i256> for &'a i256

§

type Output = i256

The resulting type after applying the + operator.
§

fn add(self, rhs: i256) -> <&'a i256 as Add<i256>>::Output

Performs the + operation. Read more
§

impl Add for i256

§

type Output = i256

The resulting type after applying the + operator.
§

fn add(self, rhs: i256) -> <i256 as Add>::Output

Performs the + operation. Read more
§

impl AddAssign for i256

§

fn add_assign(&mut self, rhs: i256)

Performs the += operation. Read more
§

impl ArrowNativeType for i256

§

fn from_usize(u: usize) -> Option<i256>

Convert native integer type from usize Read more
§

fn as_usize(self) -> usize

Convert to usize according to the as operator
§

fn usize_as(i: usize) -> i256

Convert from usize according to the as operator
§

fn to_usize(self) -> Option<usize>

Convert native type to usize. Read more
§

fn to_isize(self) -> Option<isize>

Convert native type to isize. Read more
§

fn to_i64(self) -> Option<i64>

Convert native type to i64. Read more
§

fn get_byte_width() -> usize

Returns the byte width of this native type.
§

impl ArrowNativeTypeOp for i256

§

const ZERO: i256 = i256::ZERO

The additive identity
§

const ONE: i256 = i256::ONE

The multiplicative identity
§

const MIN_TOTAL_ORDER: i256 = i256::MIN

The minimum value and identity for the 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

The maximum value and identity for the 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>

Checked addition operation
§

fn add_wrapping(self, rhs: i256) -> i256

Wrapping addition operation
§

fn sub_checked(self, rhs: i256) -> Result<i256, ArrowError>

Checked subtraction operation
§

fn sub_wrapping(self, rhs: i256) -> i256

Wrapping subtraction operation
§

fn mul_checked(self, rhs: i256) -> Result<i256, ArrowError>

Checked multiplication operation
§

fn mul_wrapping(self, rhs: i256) -> i256

Wrapping multiplication operation
§

fn div_checked(self, rhs: i256) -> Result<i256, ArrowError>

Checked division operation
§

fn div_wrapping(self, rhs: i256) -> i256

Wrapping division operation
§

fn mod_checked(self, rhs: i256) -> Result<i256, ArrowError>

Checked remainder operation
§

fn mod_wrapping(self, rhs: i256) -> i256

Wrapping remainder operation
§

fn neg_checked(self) -> Result<i256, ArrowError>

Checked negation operation
§

fn pow_checked(self, exp: u32) -> Result<i256, ArrowError>

Checked exponentiation operation
§

fn pow_wrapping(self, exp: u32) -> i256

Wrapping exponentiation operation
§

fn neg_wrapping(self) -> i256

Wrapping negation operation
§

fn is_zero(self) -> bool

Returns true if zero else false
§

fn compare(self, rhs: i256) -> Ordering

Compare operation
§

fn is_eq(self, rhs: i256) -> bool

Equality operation
§

fn is_ne(self, rhs: Self) -> bool

Not equal operation
§

fn is_lt(self, rhs: Self) -> bool

Less than operation
§

fn is_le(self, rhs: Self) -> bool

Less than equals operation
§

fn is_gt(self, rhs: Self) -> bool

Greater than operation
§

fn is_ge(self, rhs: Self) -> bool

Greater than equals operation
§

impl AsPrimitive<i256> for u32

§

fn as_(self) -> i256

Convert a value to another, using the as operator.
§

impl BitAnd for i256

§

type Output = i256

The resulting type after applying the & operator.
§

fn bitand(self, rhs: i256) -> <i256 as BitAnd>::Output

Performs the & operation. Read more
§

impl BitOr for i256

§

type Output = i256

The resulting type after applying the | operator.
§

fn bitor(self, rhs: i256) -> <i256 as BitOr>::Output

Performs the | operation. Read more
§

impl BitXor for i256

§

type Output = i256

The resulting type after applying the ^ operator.
§

fn bitxor(self, rhs: i256) -> <i256 as BitXor>::Output

Performs the ^ operation. Read more
§

impl Clone for i256

§

fn clone(&self) -> i256

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
§

impl Debug for i256

§

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

Formats the value using the given formatter. Read more
§

impl Default for i256

§

fn default() -> i256

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

impl Display for i256

§

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

Formats the value using the given formatter. Read more
§

impl<'a, 'b> Div<&'b i256> for &'a i256

§

type Output = i256

The resulting type after applying the / operator.
§

fn div(self, rhs: &'b i256) -> <&'a i256 as Div<&'b i256>>::Output

Performs the / operation. Read more
§

impl<'a> Div<&'a i256> for i256

§

type Output = i256

The resulting type after applying the / operator.
§

fn div(self, rhs: &'a i256) -> <i256 as Div<&'a i256>>::Output

Performs the / operation. Read more
§

impl<'a> Div<i256> for &'a i256

§

type Output = i256

The resulting type after applying the / operator.
§

fn div(self, rhs: i256) -> <&'a i256 as Div<i256>>::Output

Performs the / operation. Read more
§

impl Div for i256

§

type Output = i256

The resulting type after applying the / operator.
§

fn div(self, rhs: i256) -> <i256 as Div>::Output

Performs the / operation. Read more
§

impl DivAssign for i256

§

fn div_assign(&mut self, rhs: i256)

Performs the /= operation. Read more
§

impl From<i16> for i256

§

fn from(value: i16) -> i256

Converts to this type from the input type.
§

impl From<i256> for NativeAdapter<Decimal256Type>

§

fn from(value: i256) -> NativeAdapter<Decimal256Type>

Converts to this type from the input type.
§

impl From<i32> for i256

§

fn from(value: i32) -> i256

Converts to this type from the input type.
§

impl From<i64> for i256

§

fn from(value: i64) -> i256

Converts to this type from the input type.
§

impl From<i8> for i256

§

fn from(value: i8) -> i256

Converts to this type from the input type.
§

impl FromStr for i256

§

type Err = ParseI256Error

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<i256, <i256 as FromStr>::Err>

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

impl Hash for i256

§

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

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
§

impl<'a, 'b> Mul<&'b i256> for &'a i256

§

type Output = i256

The resulting type after applying the * operator.
§

fn mul(self, rhs: &'b i256) -> <&'a i256 as Mul<&'b i256>>::Output

Performs the * operation. Read more
§

impl<'a> Mul<&'a i256> for i256

§

type Output = i256

The resulting type after applying the * operator.
§

fn mul(self, rhs: &'a i256) -> <i256 as Mul<&'a i256>>::Output

Performs the * operation. Read more
§

impl<'a> Mul<i256> for &'a i256

§

type Output = i256

The resulting type after applying the * operator.
§

fn mul(self, rhs: i256) -> <&'a i256 as Mul<i256>>::Output

Performs the * operation. Read more
§

impl Mul for i256

§

type Output = i256

The resulting type after applying the * operator.
§

fn mul(self, rhs: i256) -> <i256 as Mul>::Output

Performs the * operation. Read more
§

impl MulAssign for i256

§

fn mul_assign(&mut self, rhs: i256)

Performs the *= operation. Read more
§

impl Neg for i256

§

type Output = i256

The resulting type after applying the - operator.
§

fn neg(self) -> <i256 as Neg>::Output

Performs the unary - operation. Read more
§

impl Ord for i256

§

fn cmp(&self, other: &i256) -> 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,

Restrict a value to a certain interval. Read more
§

impl PartialEq for i256

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

impl PartialOrd for i256

§

fn partial_cmp(&self, other: &i256) -> 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

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

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

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

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

impl<'a, 'b> Rem<&'b i256> for &'a i256

§

type Output = i256

The resulting type after applying the % operator.
§

fn rem(self, rhs: &'b i256) -> <&'a i256 as Rem<&'b i256>>::Output

Performs the % operation. Read more
§

impl<'a> Rem<&'a i256> for i256

§

type Output = i256

The resulting type after applying the % operator.
§

fn rem(self, rhs: &'a i256) -> <i256 as Rem<&'a i256>>::Output

Performs the % operation. Read more
§

impl<'a> Rem<i256> for &'a i256

§

type Output = i256

The resulting type after applying the % operator.
§

fn rem(self, rhs: i256) -> <&'a i256 as Rem<i256>>::Output

Performs the % operation. Read more
§

impl Rem for i256

§

type Output = i256

The resulting type after applying the % operator.
§

fn rem(self, rhs: i256) -> <i256 as Rem>::Output

Performs the % operation. Read more
§

impl RemAssign for i256

§

fn rem_assign(&mut self, rhs: i256)

Performs the %= operation. Read more
§

impl Shl<u8> for i256

§

type Output = i256

The resulting type after applying the << operator.
§

fn shl(self, rhs: u8) -> <i256 as Shl<u8>>::Output

Performs the << operation. Read more
§

impl Shr<u8> for i256

§

type Output = i256

The resulting type after applying the >> operator.
§

fn shr(self, rhs: u8) -> <i256 as Shr<u8>>::Output

Performs the >> operation. Read more
§

impl<'a, 'b> Sub<&'b i256> for &'a i256

§

type Output = i256

The resulting type after applying the - operator.
§

fn sub(self, rhs: &'b i256) -> <&'a i256 as Sub<&'b i256>>::Output

Performs the - operation. Read more
§

impl<'a> Sub<&'a i256> for i256

§

type Output = i256

The resulting type after applying the - operator.
§

fn sub(self, rhs: &'a i256) -> <i256 as Sub<&'a i256>>::Output

Performs the - operation. Read more
§

impl<'a> Sub<i256> for &'a i256

§

type Output = i256

The resulting type after applying the - operator.
§

fn sub(self, rhs: i256) -> <&'a i256 as Sub<i256>>::Output

Performs the - operation. Read more
§

impl Sub for i256

§

type Output = i256

The resulting type after applying the - operator.
§

fn sub(self, rhs: i256) -> <i256 as Sub>::Output

Performs the - operation. Read more
§

impl SubAssign for i256

§

fn sub_assign(&mut self, rhs: i256)

Performs the -= operation. Read more
§

impl ToPrimitive for i256

§

fn to_i64(&self) -> Option<i64>

Converts the value of self to an i64. If the value cannot be represented by an i64, then None is returned.
§

fn to_u64(&self) -> Option<u64>

Converts the value of self to a u64. If the value cannot be represented by a u64, then None is returned.
Source§

fn to_isize(&self) -> Option<isize>

Converts the value of self to an isize. If the value cannot be represented by an isize, then None is returned.
Source§

fn to_i8(&self) -> Option<i8>

Converts the value of self to an i8. If the value cannot be represented by an i8, then None is returned.
Source§

fn to_i16(&self) -> Option<i16>

Converts the value of self to an i16. If the value cannot be represented by an i16, then None is returned.
Source§

fn to_i32(&self) -> Option<i32>

Converts the value of self to an i32. If the value cannot be represented by an i32, then None is returned.
Source§

fn to_i128(&self) -> Option<i128>

Converts the value of self to an i128. If the value cannot be represented by an i128 (i64 under the default implementation), then None is returned. Read more
Source§

fn to_usize(&self) -> Option<usize>

Converts the value of self to a usize. If the value cannot be represented by a usize, then None is returned.
Source§

fn to_u8(&self) -> Option<u8>

Converts the value of self to a u8. If the value cannot be represented by a u8, then None is returned.
Source§

fn to_u16(&self) -> Option<u16>

Converts the value of self to a u16. If the value cannot be represented by a u16, then None is returned.
Source§

fn to_u32(&self) -> Option<u32>

Converts the value of self to a u32. If the value cannot be represented by a u32, then None is returned.
Source§

fn to_u128(&self) -> Option<u128>

Converts the value of self to a u128. If the value cannot be represented by a u128 (u64 under the default implementation), then None is returned. Read more
Source§

fn to_f32(&self) -> Option<f32>

Converts the value of self to an f32. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f32.
Source§

fn to_f64(&self) -> Option<f64>

Converts the value of 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
§

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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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.

§

impl<T> ToByteSlice for T
where T: ArrowNativeType,

§

fn to_byte_slice(&self) -> &[u8]

Converts this instance into a byte slice
Source§

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

Source§

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>,

Source§

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>,

Source§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

Source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,

Source§

impl<T, Base> RefNum<Base> for T
where T: NumOps<Base, Base> + for<'r> NumOps<&'r Base, Base>,

§

impl<T> Ungil for T
where T: Send,