pub struct GeneratorBuilder { /* private fields */ }
Expand description

A builder class to customize Generator.

Implementations§

source§

impl GeneratorBuilder

source

pub fn new() -> GeneratorBuilder

Creates a new GeneratorBuilder.

source

pub fn precision(self, precision: usize) -> GeneratorBuilder

Sets the precision for default values of f32/f64 fields.

source

pub fn nullable(self, nullable: bool) -> GeneratorBuilder

Puts default value when deserializing null field.

Doesn’t apply to union fields [“null”, “Foo”], which are Option<Foo>.

source

pub fn use_avro_rs_unions(self, use_avro_rs_unions: bool) -> GeneratorBuilder

Adds support for deserializing union types from the apache-avro crate.

Only necessary for unions of 3 or more types or 2-type unions without “null”. Note that only int, long, float, double, and boolean values are currently supported.

source

pub fn use_chrono_dates(self, use_chrono_dates: bool) -> GeneratorBuilder

Use chrono::NaiveDateTime for date/timestamps logical types

source

pub fn derive_builders(self, derive_builders: bool) -> GeneratorBuilder

Adds support to derive builders using the rust-derive-builder crate.

Applies to record structs.

source

pub fn derive_schemas(self, derive_schemas: bool) -> GeneratorBuilder

Adds support to derive avro_schema::AvroSchema.

Applies to record structs.

source

pub fn build(self) -> Result<Generator>

Create a Generator with the builder parameters.

Trait Implementations§

source§

impl Default for GeneratorBuilder

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> Same<T> for T

§

type Output = T

Should always be Self
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V