pub enum Decimal {
Int32 {
value: [u8; 4],
precision: i32,
scale: i32,
},
Int64 {
value: [u8; 8],
precision: i32,
scale: i32,
},
Bytes {
value: ByteArray,
precision: i32,
scale: i32,
},
}
Expand description
Rust representation for Decimal values.
This is not a representation of Parquet physical type, but rather a wrapper for DECIMAL logical type, and serves as container for raw parts of decimal values: unscaled value in bytes, precision and scale.
Variants§
Int32
Decimal backed by i32
.
Fields
Int64
Decimal backed by i64
.
Fields
Bytes
Decimal backed by byte array.
Implementations§
Source§impl Decimal
impl Decimal
Sourcepub fn from_i32(value: i32, precision: i32, scale: i32) -> Self
pub fn from_i32(value: i32, precision: i32, scale: i32) -> Self
Creates new decimal value from i32
.
Sourcepub fn from_i64(value: i64, precision: i32, scale: i32) -> Self
pub fn from_i64(value: i64, precision: i32, scale: i32) -> Self
Creates new decimal value from i64
.
Sourcepub fn from_bytes(value: ByteArray, precision: i32, scale: i32) -> Self
pub fn from_bytes(value: ByteArray, precision: i32, scale: i32) -> Self
Creates new decimal value from ByteArray
.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Decimal
impl RefUnwindSafe for Decimal
impl Send for Decimal
impl Sync for Decimal
impl Unpin for Decimal
impl UnwindSafe for Decimal
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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