enum Type {
Array(Box<Type>, Expr),
Option(Box<Type>),
Slice(Box<Type>),
Vec(Box<Type>),
TypePath(Type),
Reference(Option<Lifetime>, Box<Type>),
}
Variants§
Array(Box<Type>, Expr)
Option(Box<Type>)
Slice(Box<Type>)
Vec(Box<Type>)
TypePath(Type)
Reference(Option<Lifetime>, Box<Type>)
Implementations§
Source§impl Type
impl Type
Sourcefn column_writer(&self) -> TypePath
fn column_writer(&self) -> TypePath
Takes a rust type and returns the appropriate parquet-rs column writer
Sourcefn column_reader(&self) -> TypePath
fn column_reader(&self) -> TypePath
Takes a rust type and returns the appropriate parquet-rs column reader
Sourcefn leaf_type_recursive(&self) -> &Type
fn leaf_type_recursive(&self) -> &Type
Helper to simplify a nested field definition to its leaf type
Ex:
Option<&String>
=> Type::TypePath(String)
&Option<i32>
=> Type::TypePath(i32)
Vec<Vec<u8>>
=> Type::Vec(u8)
Useful in determining the physical type of a field and the definition levels.
fn leaf_type_recursive_helper<'a>( ty: &'a Type, parent_ty: Option<&'a Type>, ) -> &'a Type
Sourcefn inner_type(&self) -> &Type
fn inner_type(&self) -> &Type
Helper method to further unwrap leaf_type() to get inner-most type information, useful for determining the physical type and normalizing the type paths.
Sourcefn last_part(&self) -> String
fn last_part(&self) -> String
Helper to normalize a type path by extracting the most identifiable part
Ex:
std::string::String => String
Vec<u8>
=> Vec<u8>
chrono::NaiveDateTime => NaiveDateTime
Does run the risk of mis-identifying a type if import rename is in play. Please note procedural macros always run before type resolution so this is a risk the user takes on when renaming imports.
Sourcefn physical_type(&self) -> Type
fn physical_type(&self) -> Type
Converts rust types to parquet physical types.
Ex:
[u8; 10] => FIXED_LEN_BYTE_ARRAY
Vec<u8>
=> BYTE_ARRAY
String => BYTE_ARRAY
i32 => INT32
fn length(&self) -> Option<Expr>
fn logical_type(&self) -> TokenStream
fn converted_type(&self) -> Option<TokenStream>
fn repetition(&self) -> TokenStream
Sourcefn from(f: &Field) -> Self
fn from(f: &Field) -> Self
Convert a parsed rust field AST in to a more easy to manipulate parquet_derive::Field