Struct rsgen_avro::GeneratorBuilder
source · pub struct GeneratorBuilder { /* private fields */ }
Expand description
A builder class to customize Generator
.
Implementations§
source§impl GeneratorBuilder
impl GeneratorBuilder
sourcepub fn new() -> GeneratorBuilder
pub fn new() -> GeneratorBuilder
Creates a new GeneratorBuilder
.
sourcepub fn precision(self, precision: usize) -> GeneratorBuilder
pub fn precision(self, precision: usize) -> GeneratorBuilder
Sets the precision for default values of f32/f64 fields.
sourcepub fn nullable(self, nullable: bool) -> GeneratorBuilder
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>
.
sourcepub fn use_avro_rs_unions(self, use_avro_rs_unions: bool) -> GeneratorBuilder
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.
sourcepub fn use_chrono_dates(self, use_chrono_dates: bool) -> GeneratorBuilder
pub fn use_chrono_dates(self, use_chrono_dates: bool) -> GeneratorBuilder
Use chrono::NaiveDateTime for date/timestamps logical types
sourcepub fn derive_builders(self, derive_builders: bool) -> GeneratorBuilder
pub fn derive_builders(self, derive_builders: bool) -> GeneratorBuilder
Adds support to derive builders using the rust-derive-builder
crate.
Applies to record structs.
sourcepub fn derive_schemas(self, derive_schemas: bool) -> GeneratorBuilder
pub fn derive_schemas(self, derive_schemas: bool) -> GeneratorBuilder
Adds support to derive avro_schema::AvroSchema
.
Applies to record structs.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for GeneratorBuilder
impl Send for GeneratorBuilder
impl Sync for GeneratorBuilder
impl Unpin for GeneratorBuilder
impl UnwindSafe for GeneratorBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more