Struct arrow_buffer::i256
source · pub struct i256 { /* private fields */ }
Expand description
A signed 256-bit integer
Implementations§
source§impl i256
impl i256
sourcepub const fn from_le_bytes(b: [u8; 32]) -> Self
pub const fn from_le_bytes(b: [u8; 32]) -> Self
Create an integer value from its representation as a byte array in little-endian.
sourcepub const fn from_be_bytes(b: [u8; 32]) -> Self
pub const fn from_be_bytes(b: [u8; 32]) -> Self
Create an integer value from its representation as a byte array in big-endian.
pub const fn from_i128(v: i128) -> Self
sourcepub fn from_string(value_str: &str) -> Option<Self>
pub fn from_string(value_str: &str) -> Option<Self>
Create an integer value from its representation as string.
sourcepub fn from_f64(v: f64) -> Option<Self>
pub fn from_f64(v: f64) -> Option<Self>
Create an optional i256 from the provided f64
. Returning None
if overflow occurred
sourcepub const fn from_parts(low: u128, high: i128) -> Self
pub const fn from_parts(low: u128, high: i128) -> Self
Create an i256 from the provided low u128 and high i128
sourcepub 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
sourcepub 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.
sourcepub 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.
sourcepub fn wrapping_abs(self) -> Self
pub fn wrapping_abs(self) -> Self
Computes the absolute value of this i256
sourcepub fn checked_abs(self) -> Option<Self>
pub fn checked_abs(self) -> Option<Self>
Computes the absolute value of this i256 returning None
if Self == Self::MIN
sourcepub fn wrapping_neg(self) -> Self
pub fn wrapping_neg(self) -> Self
Negates this i256
sourcepub fn checked_neg(self) -> Option<Self>
pub fn checked_neg(self) -> Option<Self>
Negates this i256 returning None
if Self == Self::MIN
sourcepub fn wrapping_add(self, other: Self) -> Self
pub fn wrapping_add(self, other: Self) -> Self
Performs wrapping addition
sourcepub fn checked_add(self, other: Self) -> Option<Self>
pub fn checked_add(self, other: Self) -> Option<Self>
Performs checked addition
sourcepub fn wrapping_sub(self, other: Self) -> Self
pub fn wrapping_sub(self, other: Self) -> Self
Performs wrapping subtraction
sourcepub fn checked_sub(self, other: Self) -> Option<Self>
pub fn checked_sub(self, other: Self) -> Option<Self>
Performs checked subtraction
sourcepub fn wrapping_mul(self, other: Self) -> Self
pub fn wrapping_mul(self, other: Self) -> Self
Performs wrapping multiplication
sourcepub fn checked_mul(self, other: Self) -> Option<Self>
pub fn checked_mul(self, other: Self) -> Option<Self>
Performs checked multiplication
sourcepub fn wrapping_div(self, other: Self) -> Self
pub fn wrapping_div(self, other: Self) -> Self
Performs wrapping division
sourcepub fn checked_div(self, other: Self) -> Option<Self>
pub fn checked_div(self, other: Self) -> Option<Self>
Performs checked division
sourcepub fn wrapping_rem(self, other: Self) -> Self
pub fn wrapping_rem(self, other: Self) -> Self
Performs wrapping remainder
sourcepub fn checked_rem(self, other: Self) -> Option<Self>
pub fn checked_rem(self, other: Self) -> Option<Self>
Performs checked remainder
sourcepub fn checked_pow(self, exp: u32) -> Option<Self>
pub fn checked_pow(self, exp: u32) -> Option<Self>
Performs checked exponentiation
sourcepub fn wrapping_pow(self, exp: u32) -> Self
pub fn wrapping_pow(self, exp: u32) -> Self
Performs wrapping exponentiation
sourcepub const fn is_negative(self) -> bool
pub const fn is_negative(self) -> bool
Returns true
if this i256
is negative
sourcepub const fn is_positive(self) -> bool
pub const fn is_positive(self) -> bool
Returns true
if this i256
is positive
Trait Implementations§
source§impl ArrowNativeType for i256
impl ArrowNativeType for i256
source§impl AsPrimitive<i256> for i16
impl AsPrimitive<i256> for i16
source§impl AsPrimitive<i256> for i32
impl AsPrimitive<i256> for i32
source§impl AsPrimitive<i256> for i64
impl AsPrimitive<i256> for i64
source§impl AsPrimitive<i256> for i8
impl AsPrimitive<i256> for i8
source§impl AsPrimitive<i256> for u16
impl AsPrimitive<i256> for u16
source§impl AsPrimitive<i256> for u32
impl AsPrimitive<i256> for u32
source§impl AsPrimitive<i256> for u64
impl AsPrimitive<i256> for u64
source§impl AsPrimitive<i256> for u8
impl AsPrimitive<i256> for u8
source§impl Ord for i256
impl Ord for i256
source§impl PartialEq<i256> for i256
impl PartialEq<i256> for i256
source§impl PartialOrd<i256> for i256
impl PartialOrd<i256> for i256
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl ToPrimitive for i256
impl ToPrimitive for i256
source§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.source§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.source§fn to_u128(&self) -> Option<u128>
fn to_u128(&self) -> Option<u128>
self
to a u128
. If the value cannot be
represented by a u128
(u64
under the default implementation), then
None
is returned. Read more