pub struct GenericDatumWriterBuilder<'s, S: State = Empty> { /* private fields */ }Expand description
Use builder syntax to set the inputs and finish with build().
Implementations§
Source§impl<'s, S: State> GenericDatumWriterBuilder<'s, S>
impl<'s, S: State> GenericDatumWriterBuilder<'s, S>
Sourcepub fn build(self) -> AvroResult<GenericDatumWriter<'s>>where
S: IsComplete,
pub fn build(self) -> AvroResult<GenericDatumWriter<'s>>where
S: IsComplete,
Finishes building and performs the requested action.
Sourcepub fn resolved_schemata(
self,
value: ResolvedSchema<'s>,
) -> GenericDatumWriterBuilder<'s, SetResolvedSchemata<S>>where
S::ResolvedSchemata: IsUnset,
pub fn resolved_schemata(
self,
value: ResolvedSchema<'s>,
) -> GenericDatumWriterBuilder<'s, SetResolvedSchemata<S>>where
S::ResolvedSchemata: IsUnset,
Optional (Some / Option setters). Already resolved schemata that will be used to resolve references in the writer’s schema.
You can also use Self::schemata instead.
Sourcepub fn maybe_resolved_schemata(
self,
value: Option<ResolvedSchema<'s>>,
) -> GenericDatumWriterBuilder<'s, SetResolvedSchemata<S>>where
S::ResolvedSchemata: IsUnset,
pub fn maybe_resolved_schemata(
self,
value: Option<ResolvedSchema<'s>>,
) -> GenericDatumWriterBuilder<'s, SetResolvedSchemata<S>>where
S::ResolvedSchemata: IsUnset,
Optional (Some / Option setters). Already resolved schemata that will be used to resolve references in the writer’s schema.
You can also use Self::schemata instead.
Sourcepub fn validate(
self,
value: bool,
) -> GenericDatumWriterBuilder<'s, SetValidate<S>>where
S::Validate: IsUnset,
pub fn validate(
self,
value: bool,
) -> GenericDatumWriterBuilder<'s, SetValidate<S>>where
S::Validate: IsUnset,
Sourcepub fn maybe_validate(
self,
value: Option<bool>,
) -> GenericDatumWriterBuilder<'s, SetValidate<S>>where
S::Validate: IsUnset,
pub fn maybe_validate(
self,
value: Option<bool>,
) -> GenericDatumWriterBuilder<'s, SetValidate<S>>where
S::Validate: IsUnset,
Sourcepub fn target_block_size(
self,
value: usize,
) -> GenericDatumWriterBuilder<'s, SetTargetBlockSize<S>>where
S::TargetBlockSize: IsUnset,
pub fn target_block_size(
self,
value: usize,
) -> GenericDatumWriterBuilder<'s, SetTargetBlockSize<S>>where
S::TargetBlockSize: IsUnset,
Optional (Some / Option setters). At what block size to start a new block (for arrays and maps).
This is a minimum value, the block size will always be larger than this except for the last block.
When set to None all values will be written in a single block. This can be faster as no
intermediate buffer is used, but seeking through written data will be slower.
Sourcepub fn maybe_target_block_size(
self,
value: Option<usize>,
) -> GenericDatumWriterBuilder<'s, SetTargetBlockSize<S>>where
S::TargetBlockSize: IsUnset,
pub fn maybe_target_block_size(
self,
value: Option<usize>,
) -> GenericDatumWriterBuilder<'s, SetTargetBlockSize<S>>where
S::TargetBlockSize: IsUnset,
Optional (Some / Option setters). At what block size to start a new block (for arrays and maps).
This is a minimum value, the block size will always be larger than this except for the last block.
When set to None all values will be written in a single block. This can be faster as no
intermediate buffer is used, but seeking through written data will be slower.
Sourcepub fn human_readable(
self,
value: bool,
) -> GenericDatumWriterBuilder<'s, SetHumanReadable<S>>where
S::HumanReadable: IsUnset,
pub fn human_readable(
self,
value: bool,
) -> GenericDatumWriterBuilder<'s, SetHumanReadable<S>>where
S::HumanReadable: IsUnset,
Sourcepub fn maybe_human_readable(
self,
value: Option<bool>,
) -> GenericDatumWriterBuilder<'s, SetHumanReadable<S>>where
S::HumanReadable: IsUnset,
pub fn maybe_human_readable(
self,
value: Option<bool>,
) -> GenericDatumWriterBuilder<'s, SetHumanReadable<S>>where
S::HumanReadable: IsUnset,
Source§impl<'s, S: State> GenericDatumWriterBuilder<'s, S>
impl<'s, S: State> GenericDatumWriterBuilder<'s, S>
Sourcepub fn schemata(
self,
schemata: Vec<&'s Schema>,
) -> AvroResult<GenericDatumWriterBuilder<'s, SetResolvedSchemata<S>>>where
S::ResolvedSchemata: IsUnset,
pub fn schemata(
self,
schemata: Vec<&'s Schema>,
) -> AvroResult<GenericDatumWriterBuilder<'s, SetResolvedSchemata<S>>>where
S::ResolvedSchemata: IsUnset,
Set the schemata that will be used to resolve any references in the schema.
This is equivalent to .resolved_schemata(ResolvedSchema::new_with_schemata(schemata)?).
If you already have a ResolvedSchema, use that function instead.