Enum parquet::data_type::Decimal [−][src]
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,
},
}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
Int32Decimal backed by i32.
Fields of Int32
value: [u8; 4] | |
precision: i32 | |
scale: i32 |
Int64Decimal backed by i64.
Fields of Int64
value: [u8; 8] | |
precision: i32 | |
scale: i32 |
BytesDecimal backed by byte array.
Fields of Bytes
value: ByteArray | |
precision: i32 | |
scale: i32 |
Methods
impl Decimal[src]
impl Decimalpub fn from_i32(value: i32, precision: i32, scale: i32) -> Self[src]
pub fn from_i32(value: i32, precision: i32, scale: i32) -> SelfCreates new decimal value from i32.
pub fn from_i64(value: i64, precision: i32, scale: i32) -> Self[src]
pub fn from_i64(value: i64, precision: i32, scale: i32) -> SelfCreates new decimal value from i64.
pub fn from_bytes(value: ByteArray, precision: i32, scale: i32) -> Self[src]
pub fn from_bytes(value: ByteArray, precision: i32, scale: i32) -> SelfCreates new decimal value from ByteArray.
pub fn data(&self) -> &[u8][src]
pub fn data(&self) -> &[u8]Returns bytes of unscaled value.
pub fn precision(&self) -> i32[src]
pub fn precision(&self) -> i32Returns decimal precision.
pub fn scale(&self) -> i32[src]
pub fn scale(&self) -> i32Returns decimal scale.
Trait Implementations
impl Clone for Decimal[src]
impl Clone for Decimalfn clone(&self) -> Decimal[src]
fn clone(&self) -> DecimalReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Debug for Decimal[src]
impl Debug for Decimalfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Default for Decimal[src]
impl Default for Decimalimpl PartialEq for Decimal[src]
impl PartialEq for Decimalfn eq(&self, other: &Decimal) -> bool[src]
fn eq(&self, other: &Decimal) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl AsBytes for Decimal[src]
impl AsBytes for Decimal