pub struct i256(/* private fields */);Expand description
Signed 256-bit integer type.
This one of the physical representations of DecimalScalar values and can be safely converted
back and forth with Arrow’s i256.
Implementations§
Source§impl i256
impl i256
pub const ZERO: Self
pub const ONE: Self
pub const MAX: Self
pub const MIN: Self
Sourcepub const fn from_parts(lower: u128, upper: i128) -> Self
pub const fn from_parts(lower: u128, upper: i128) -> Self
Construct a new i256 from an unsigned lower bits and a signed upper bits.
pub fn maybe_i128(self) -> Option<i128>
Sourcepub const fn from_le_bytes(bytes: [u8; 32]) -> Self
pub const fn from_le_bytes(bytes: [u8; 32]) -> Self
Create an integer value from its representation as a byte array in little-endian.
Sourcepub const fn into_parts(self) -> (u128, i128)
pub const fn into_parts(self) -> (u128, i128)
Split the 256-bit signed integer value into an unsigned lower bits and a signed upper bits.
This versions gives us ownership of the value.
Sourcepub const fn to_parts(&self) -> (u128, i128)
pub const fn to_parts(&self) -> (u128, i128)
Split the 256-bit signed integer value into an unsigned lower bits and a signed upper bits.
pub fn wrapping_pow(&self, exp: u32) -> Self
pub fn wrapping_add(&self, other: Self) -> Self
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.
Trait Implementations§
Source§impl BigCast for i256
impl BigCast for i256
Source§fn from<T: ToPrimitive>(n: T) -> Option<Self>
fn from<T: ToPrimitive>(n: T) -> Option<Self>
Cast the value
n to Self using the relevant ToPrimitive method. If the value cannot
be represented by Self, None is returned.Source§impl CheckedAdd for i256
impl CheckedAdd for i256
Source§fn checked_add(&self, v: &Self) -> Option<Self>
fn checked_add(&self, v: &Self) -> Option<Self>
Adds two numbers, checking for overflow. If overflow happens,
None is
returned.Source§impl CheckedSub for i256
impl CheckedSub for i256
Source§fn checked_sub(&self, v: &Self) -> Option<Self>
fn checked_sub(&self, v: &Self) -> Option<Self>
Subtracts two numbers, checking for underflow. If underflow happens,
None is returned.Source§impl From<i256> for DecimalValue
impl From<i256> for DecimalValue
Source§impl NativeDecimalType for i256
impl NativeDecimalType for i256
const VALUES_TYPE: DecimalValueType = DecimalValueType::I256
fn maybe_from(decimal_type: DecimalValue) -> Option<Self>
Source§impl Ord for i256
impl Ord for i256
Source§impl PartialOrd for i256
impl PartialOrd for i256
Source§impl ToPrimitive for i256
impl ToPrimitive for i256
Source§impl ToPrimitive for i256
impl ToPrimitive for i256
Source§fn to_i64(&self) -> Option<i64>
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_i128(&self) -> Option<i128>
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 moreSource§fn to_u64(&self) -> Option<u64>
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_u128(&self) -> Option<u128>
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 moreSource§fn to_isize(&self) -> Option<isize>
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>
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>
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>
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_usize(&self) -> Option<usize>
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>
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>
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>
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§impl TryFrom<DecimalScalar<'_>> for i256
impl TryFrom<DecimalScalar<'_>> for i256
Source§type Error = VortexError
type Error = VortexError
The type returned in the event of a conversion error.
Source§impl WrappingAdd for i256
impl WrappingAdd for i256
Source§fn wrapping_add(&self, v: &Self) -> Self
fn wrapping_add(&self, v: &Self) -> Self
Wrapping (modular) addition. Computes
self + other, wrapping around at the boundary of
the type.Source§impl WrappingSub for i256
impl WrappingSub for i256
Source§fn wrapping_sub(&self, v: &Self) -> Self
fn wrapping_sub(&self, v: &Self) -> Self
Wrapping (modular) subtraction. Computes
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more