pub trait ParquetValueType:
PartialEq
+ Debug
+ Display
+ Default
+ Clone
+ AsBytes
+ FromBytes
+ SliceAsBytes
+ PartialOrd
+ Send
+ HeapSize
+ GetDecoder
+ MakeStatistics {
const PHYSICAL_TYPE: Type;
// Required methods
fn encode<W: Write>(
values: &[Self],
writer: &mut W,
bit_writer: &mut BitWriter,
) -> Result<()>;
fn set_data(
decoder: &mut PlainDecoderDetails,
data: Bytes,
num_values: usize,
);
fn decode(
buffer: &mut [Self],
decoder: &mut PlainDecoderDetails,
) -> Result<usize>;
fn skip(
decoder: &mut PlainDecoderDetails,
num_values: usize,
) -> Result<usize>;
fn as_any(&self) -> &dyn Any;
fn as_mut_any(&mut self) -> &mut dyn Any;
// Provided methods
fn dict_encoding_size(&self) -> (usize, usize) { ... }
fn variable_length_bytes(_: &[Self]) -> Option<i64> { ... }
fn as_i64(&self) -> Result<i64> { ... }
fn as_u64(&self) -> Result<u64> { ... }
fn set_from_bytes(&mut self, _data: Bytes) { ... }
}
Expand description
Sealed trait to start to remove specialisation from implementations
This is done to force the associated value type to be unimplementable outside of this crate, and thus hint to the type system (and end user) traits are public for the contract and not for extension.
Required Associated Constants§
const PHYSICAL_TYPE: Type
Required Methods§
Sourcefn encode<W: Write>(
values: &[Self],
writer: &mut W,
bit_writer: &mut BitWriter,
) -> Result<()>
fn encode<W: Write>( values: &[Self], writer: &mut W, bit_writer: &mut BitWriter, ) -> Result<()>
Encode the value directly from a higher level encoder
Sourcefn set_data(decoder: &mut PlainDecoderDetails, data: Bytes, num_values: usize)
fn set_data(decoder: &mut PlainDecoderDetails, data: Bytes, num_values: usize)
Establish the data that will be decoded in a buffer
Sourcefn decode(
buffer: &mut [Self],
decoder: &mut PlainDecoderDetails,
) -> Result<usize>
fn decode( buffer: &mut [Self], decoder: &mut PlainDecoderDetails, ) -> Result<usize>
Decode the value from a given buffer for a higher level decoder
fn skip(decoder: &mut PlainDecoderDetails, num_values: usize) -> Result<usize>
Sourcefn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Return the value as an Any to allow for downcasts without transmutation
Sourcefn as_mut_any(&mut self) -> &mut dyn Any
fn as_mut_any(&mut self) -> &mut dyn Any
Return the value as an mutable Any to allow for downcasts without transmutation
Provided Methods§
Sourcefn dict_encoding_size(&self) -> (usize, usize)
fn dict_encoding_size(&self) -> (usize, usize)
Return the encoded size for a type
Sourcefn variable_length_bytes(_: &[Self]) -> Option<i64>
fn variable_length_bytes(_: &[Self]) -> Option<i64>
Return the number of variable length bytes in a given slice of data
Returns the sum of lengths for BYTE_ARRAY data, and None for all other data types
Sourcefn as_i64(&self) -> Result<i64>
fn as_i64(&self) -> Result<i64>
Return the value as i64 if possible
This is essentially the same as std::convert::TryInto<i64>
but can’t be
implemented for f32
and f64
, types that would fail orphan rules
Sourcefn as_u64(&self) -> Result<u64>
fn as_u64(&self) -> Result<u64>
Return the value as u64 if possible
This is essentially the same as std::convert::TryInto<u64>
but can’t be
implemented for f32
and f64
, types that would fail orphan rules
Sourcefn set_from_bytes(&mut self, _data: Bytes)
fn set_from_bytes(&mut self, _data: Bytes)
Sets the value of this object from the provided [Bytes
]
Only implemented for ByteArray
and FixedLenByteArray
. Will panic for other types.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.