parquet_derive::parquet_field

Struct Field

Source
pub struct Field {
    ident: Ident,
    ty: Type,
    is_a_byte_buf: bool,
    third_party_type: Option<ThirdPartyType>,
}

Fields§

§ident: Ident§ty: Type§is_a_byte_buf: bool§third_party_type: Option<ThirdPartyType>

Implementations§

Source§

impl Field

Source

pub fn from(f: &Field) -> Self

Source

pub fn writer_snippet(&self) -> TokenStream

Takes the parsed field of the struct and emits a valid column writer snippet. Should match exactly what you would write by hand.

Can only generate writers for basic structs, for example:

struct Record { a_bool: bool, maybe_a_bool: Option<bool> }

but not

struct UnsupportedNestedRecord { a_property: bool, nested_record: Record }

because this parsing logic is not sophisticated enough for definition levels beyond 2.

Source

pub fn reader_snippet(&self) -> TokenStream

Takes the parsed field of the struct and emits a valid column reader snippet. Should match exactly what you would write by hand.

Can only generate writers for basic structs, for example:

struct Record { a_bool: bool }

but not

struct UnsupportedNestedRecord { a_property: bool, nested_record: Record }

because this parsing logic is not sophisticated enough for definition levels beyond 2.

Option types and references not supported, but the column itself can be nullable (i.e., def_level==1), as long as the values are all valid.

Source

pub fn parquet_type(&self) -> TokenStream

Source

fn option_into_vals(&self) -> TokenStream

Source

fn copied_direct_vals(&self) -> TokenStream

Source

fn copied_direct_fields(&self) -> TokenStream

Source

fn optional_definition_levels(&self) -> TokenStream

Trait Implementations§

Source§

impl Debug for Field

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Field

Source§

fn eq(&self, other: &Field) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Field

Auto Trait Implementations§

§

impl Freeze for Field

§

impl RefUnwindSafe for Field

§

impl !Send for Field

§

impl !Sync for Field

§

impl Unpin for Field

§

impl UnwindSafe for Field

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.