pub struct Decimal256 { /* private fields */ }
Expand description
Represents a decimal value with precision and scale. The decimal value could be represented by a signed 256-bit integer.
Trait Implementations
sourceimpl BasicDecimal for Decimal256
impl BasicDecimal for Decimal256
sourcefn new(precision: usize, scale: usize, bytes: &[u8]) -> Self
fn new(precision: usize, scale: usize, bytes: &[u8]) -> Self
Creates a decimal value from precision, scale, and bytes. Read more
sourcefn raw_value(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
fn raw_value(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Returns the raw bytes of the integer representation of the decimal.
sourcefn try_new_from_bytes(
precision: usize,
scale: usize,
bytes: &[u8]
) -> Result<Self> where
Self: Sized,
fn try_new_from_bytes(
precision: usize,
scale: usize,
bytes: &[u8]
) -> Result<Self> where
Self: Sized,
Tries to create a decimal value from precision, scale and bytes. If the length of bytes isn’t same as the bit width of this decimal, returning an error. The bytes should be stored in little-endian order. Read more
sourceimpl BasicDecimalArray<Decimal256, Decimal256Array> for Decimal256Array
impl BasicDecimalArray<Decimal256, Decimal256Array> for Decimal256Array
const VALUE_LENGTH: i32 = 32i32
fn data(&self) -> &ArrayData
sourcefn precision(&self) -> usize
fn precision(&self) -> usize
Return the precision (total digits) that can be stored by this array
sourcefn scale(&self) -> usize
fn scale(&self) -> usize
Return the scale (digits after the decimal) that can be stored by this array
sourcefn value_offset(&self, i: usize) -> i32
fn value_offset(&self, i: usize) -> i32
Returns the offset for the element at index i
. Read more
sourcefn value_length(&self) -> i32
fn value_length(&self) -> i32
Returns the length for an element. Read more
sourcefn value_data(&self) -> Buffer
fn value_data(&self) -> Buffer
Returns a clone of the value data buffer
fn value_offset_at(&self, i: usize) -> i32
fn value_as_string(&self, row: usize) -> String
sourcefn from_fixed_size_binary_array(
v: FixedSizeBinaryArray,
precision: usize,
scale: usize
) -> U
fn from_fixed_size_binary_array(
v: FixedSizeBinaryArray,
precision: usize,
scale: usize
) -> U
Build a decimal array from FixedSizeBinaryArray
. Read more
sourcefn from_fixed_size_list_array(
v: FixedSizeListArray,
precision: usize,
scale: usize
) -> U
fn from_fixed_size_list_array(
v: FixedSizeListArray,
precision: usize,
scale: usize
) -> U
please use from_fixed_size_binary_array
instead
Build a decimal array from FixedSizeListArray
. Read more
sourceimpl Debug for Decimal256
impl Debug for Decimal256
sourceimpl Ord for Decimal256
impl Ord for Decimal256
sourceimpl PartialEq<Decimal256> for Decimal256
impl PartialEq<Decimal256> for Decimal256
sourceimpl PartialOrd<Decimal256> for Decimal256
impl PartialOrd<Decimal256> for Decimal256
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
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 · sourcefn lt(&self, other: &Rhs) -> bool
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 · sourcefn le(&self, other: &Rhs) -> bool
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
impl Eq for Decimal256
Auto Trait Implementations
impl RefUnwindSafe for Decimal256
impl Send for Decimal256
impl Sync for Decimal256
impl Unpin for Decimal256
impl UnwindSafe for Decimal256
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.