pub struct i256(/* private fields */);Expand description
Signed 256-bit integer type.
This is 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
Sourcepub const fn from_parts(lower: u128, upper: i128) -> i256
pub const fn from_parts(lower: u128, upper: i128) -> i256
Construct a new i256 from an unsigned lower bits and a signed upper bits.
Sourcepub fn maybe_i128(self) -> Option<i128>
pub fn maybe_i128(self) -> Option<i128>
Attempts to convert this i256 to an i128.
Returns None if the value is too large to fit in an i128.
Sourcepub const fn from_le_bytes(bytes: [u8; 32]) -> i256
pub const fn from_le_bytes(bytes: [u8; 32]) -> i256
Create an integer value from its little-endian byte array representation.
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 version 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.
Sourcepub fn wrapping_pow(&self, exp: u32) -> i256
pub fn wrapping_pow(&self, exp: u32) -> i256
Raises self to the power of exp, wrapping around on overflow.
Sourcepub fn checked_pow(&self, exp: u32) -> Option<i256>
pub fn checked_pow(&self, exp: u32) -> Option<i256>
Raises self to the power of exp, wrapping around on overflow.
Sourcepub fn wrapping_add(&self, other: i256) -> i256
pub fn wrapping_add(&self, other: i256) -> i256
Wrapping (modular) addition. Computes self + other, wrapping around at the boundary.
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 AddAssign for i256
impl AddAssign for i256
Source§fn add_assign(&mut self, rhs: i256)
fn add_assign(&mut self, rhs: i256)
+= operation. Read moreSource§impl AsPrimitive<i128> for i256
impl AsPrimitive<i128> for i256
Source§impl AsPrimitive<i16> for i256
impl AsPrimitive<i16> for i256
Source§impl AsPrimitive<i256> for i256
impl AsPrimitive<i256> for i256
Source§impl AsPrimitive<i32> for i256
impl AsPrimitive<i32> for i256
Source§impl AsPrimitive<i64> for i256
impl AsPrimitive<i64> for i256
Source§impl AsPrimitive<i8> for i256
impl AsPrimitive<i8> for i256
Source§impl CheckedAdd for i256
impl CheckedAdd for i256
Source§impl CheckedDiv for i256
impl CheckedDiv for i256
Source§impl CheckedMul for i256
impl CheckedMul for i256
Source§impl CheckedSub for i256
impl CheckedSub for i256
Source§impl From<i256> for DecimalValue
impl From<i256> for DecimalValue
Source§impl NativeDecimalType for i256
impl NativeDecimalType for i256
Source§const DECIMAL_TYPE: DecimalType = DecimalType::I256
const DECIMAL_TYPE: DecimalType = DecimalType::I256
Source§const MAX_PRECISION: u8 = 76u8
const MAX_PRECISION: u8 = 76u8
Source§const MIN_BY_PRECISION: &'static [i256]
const MIN_BY_PRECISION: &'static [i256]
MAX_PRECISION + 1 where the ith element is the minimum value
for a precision of i (including precision 0).Source§const MAX_BY_PRECISION: &'static [i256]
const MAX_BY_PRECISION: &'static [i256]
MIN_BY_PRECISION.Source§fn downcast<V>(visitor: V) -> <V as DecimalTypeDowncast>::Output<i256>where
V: DecimalTypeDowncast,
fn downcast<V>(visitor: V) -> <V as DecimalTypeDowncast>::Output<i256>where
V: DecimalTypeDowncast,
Source§fn upcast<V>(input: <V as DecimalTypeUpcast>::Input<i256>) -> Vwhere
V: DecimalTypeUpcast,
fn upcast<V>(input: <V as DecimalTypeUpcast>::Input<i256>) -> Vwhere
V: DecimalTypeUpcast,
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§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_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_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_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 moreSource§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_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§impl TryFrom<DecimalScalar<'_>> for i256
impl TryFrom<DecimalScalar<'_>> for i256
Source§type Error = VortexError
type Error = VortexError
Source§impl WrappingAdd for i256
impl WrappingAdd for i256
Source§fn wrapping_add(&self, v: &i256) -> i256
fn wrapping_add(&self, v: &i256) -> i256
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: &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 Int 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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.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>
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>
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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.