Struct arrow_buffer::i256

source ·
pub struct i256 { /* private fields */ }
Expand description

A signed 256-bit integer

Implementations§

source§

impl i256

source

pub const ZERO: Self = _

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

source

pub const ONE: Self = _

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

source

pub const MINUS_ONE: Self = _

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

source

pub const MAX: Self = _

The maximum value that can be represented by this integer type

source

pub const MIN: Self = _

The minimum value that can be represented by this integer type

source

pub const fn from_le_bytes(b: [u8; 32]) -> Self

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

source

pub const fn from_be_bytes(b: [u8; 32]) -> Self

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

source

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

source

pub fn from_string(value_str: &str) -> Option<Self>

Create an integer value from its representation as string.

source

pub fn from_f64(v: f64) -> Option<Self>

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

source

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

Create an i256 from the provided low u128 and high i128

source

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

Returns this i256 as a low u128 and high i128

source

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

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

source

pub fn as_i128(self) -> i128

Wraps this i256 into an i128

source

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.

source

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.

source

pub fn wrapping_abs(self) -> Self

Computes the absolute value of this i256

source

pub fn checked_abs(self) -> Option<Self>

Computes the absolute value of this i256 returning None if Self == Self::MIN

source

pub fn wrapping_neg(self) -> Self

Negates this i256

source

pub fn checked_neg(self) -> Option<Self>

Negates this i256 returning None if Self == Self::MIN

source

pub fn wrapping_add(self, other: Self) -> Self

Performs wrapping addition

source

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

Performs checked addition

source

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

Performs wrapping subtraction

source

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

Performs checked subtraction

source

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

Performs wrapping multiplication

source

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

Performs checked multiplication

source

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

Performs wrapping division

source

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

Performs checked division

source

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

Performs wrapping remainder

source

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

Performs checked remainder

source

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

Performs checked exponentiation

source

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

Performs wrapping exponentiation

source

pub const fn signum(self) -> Self

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

source

pub const fn is_negative(self) -> bool

Returns true if this i256 is negative

source

pub const fn is_positive(self) -> bool

Returns true if this i256 is positive

Trait Implementations§

source§

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

§

type Output = i256

The resulting type after applying the + operator.
source§

fn add(self, rhs: &'a i256) -> Self::Output

Performs the + operation. Read more
source§

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

§

type Output = i256

The resulting type after applying the + operator.
source§

fn add(self, rhs: &'b i256) -> Self::Output

Performs the + operation. Read more
source§

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

§

type Output = i256

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add<i256> for i256

§

type Output = i256

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl ArrowNativeType for i256

source§

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

Convert native integer type from usize Read more
source§

fn as_usize(self) -> usize

Convert to usize according to the as operator
source§

fn usize_as(i: usize) -> Self

Convert from usize according to the as operator
source§

fn to_usize(self) -> Option<usize>

Convert native type to usize. Read more
source§

fn to_isize(self) -> Option<isize>

Convert native type to isize. Read more
source§

fn from_i32(_: i32) -> Option<Self>

👎Deprecated: please use Option::Some instead
Convert native type from i32. Read more
source§

fn from_i64(_: i64) -> Option<Self>

👎Deprecated: please use Option::Some instead
Convert native type from i64. Read more
source§

fn from_i128(_: i128) -> Option<Self>

👎Deprecated: please use Option::Some instead
Convert native type from i128. Read more
source§

impl AsPrimitive<i256> for i16

source§

fn as_(self) -> i256

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

impl AsPrimitive<i256> for i32

source§

fn as_(self) -> i256

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

impl AsPrimitive<i256> for i64

source§

fn as_(self) -> i256

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

impl AsPrimitive<i256> for i8

source§

fn as_(self) -> i256

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

impl AsPrimitive<i256> for u16

source§

fn as_(self) -> i256

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

impl AsPrimitive<i256> for u32

source§

fn as_(self) -> i256

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

impl AsPrimitive<i256> for u64

source§

fn as_(self) -> i256

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

impl AsPrimitive<i256> for u8

source§

fn as_(self) -> i256

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

impl BitAnd<i256> for i256

§

type Output = i256

The resulting type after applying the & operator.
source§

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

Performs the & operation. Read more
source§

impl BitOr<i256> for i256

§

type Output = i256

The resulting type after applying the | operator.
source§

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

Performs the | operation. Read more
source§

impl BitXor<i256> for i256

§

type Output = i256

The resulting type after applying the ^ operator.
source§

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

Performs the ^ operation. Read more
source§

impl Clone for i256

source§

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

impl Debug for i256

source§

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

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

impl Default for i256

source§

fn default() -> i256

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

impl Display for i256

source§

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

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

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

§

type Output = i256

The resulting type after applying the / operator.
source§

fn div(self, rhs: &'a i256) -> Self::Output

Performs the / operation. Read more
source§

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

§

type Output = i256

The resulting type after applying the / operator.
source§

fn div(self, rhs: &'b i256) -> Self::Output

Performs the / operation. Read more
source§

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

§

type Output = i256

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl Div<i256> for i256

§

type Output = i256

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl From<i16> for i256

source§

fn from(value: i16) -> Self

Converts to this type from the input type.
source§

impl From<i32> for i256

source§

fn from(value: i32) -> Self

Converts to this type from the input type.
source§

impl From<i64> for i256

source§

fn from(value: i64) -> Self

Converts to this type from the input type.
source§

impl From<i8> for i256

source§

fn from(value: i8) -> Self

Converts to this type from the input type.
source§

impl FromStr for i256

§

type Err = ParseI256Error

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 i256

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<'a> Mul<&'a i256> for i256

§

type Output = i256

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &'a i256) -> Self::Output

Performs the * operation. Read more
source§

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

§

type Output = i256

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &'b i256) -> Self::Output

Performs the * operation. Read more
source§

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

§

type Output = i256

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<i256> for i256

§

type Output = i256

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Neg for i256

§

type Output = i256

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl Ord for i256

source§

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

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

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

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

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

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

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

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

impl PartialEq<i256> for i256

source§

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

source§

fn partial_cmp(&self, other: &Self) -> 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<'a> Rem<&'a i256> for i256

§

type Output = i256

The resulting type after applying the % operator.
source§

fn rem(self, rhs: &'a i256) -> Self::Output

Performs the % operation. Read more
source§

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

§

type Output = i256

The resulting type after applying the % operator.
source§

fn rem(self, rhs: &'b i256) -> Self::Output

Performs the % operation. Read more
source§

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

§

type Output = i256

The resulting type after applying the % operator.
source§

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

Performs the % operation. Read more
source§

impl Rem<i256> for i256

§

type Output = i256

The resulting type after applying the % operator.
source§

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

Performs the % operation. Read more
source§

impl Shl<u8> for i256

§

type Output = i256

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

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

Performs the << operation. Read more
source§

impl Shr<u8> for i256

§

type Output = i256

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

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

Performs the >> operation. Read more
source§

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

§

type Output = i256

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &'a i256) -> Self::Output

Performs the - operation. Read more
source§

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

§

type Output = i256

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &'b i256) -> Self::Output

Performs the - operation. Read more
source§

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

§

type Output = i256

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl Sub<i256> for i256

§

type Output = i256

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl ToPrimitive for i256

source§

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

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

impl Copy for i256

source§

impl Eq for i256

source§

impl StructuralEq for i256

source§

impl StructuralPartialEq for i256

Auto Trait Implementations§

§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> ToByteSlice for Twhere T: ArrowNativeType,

source§

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

Converts this instance into a byte slice
source§

impl<T> ToOwned for Twhere 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 Twhere 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 Twhere 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 Twhere 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> Allocation for Twhere T: RefUnwindSafe + Send + Sync,

source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for Twhere 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 Twhere T: NumOps<Base, Base> + for<'r> NumOps<&'r Base, Base>,