Skip to main content

SpecificSingleObjectWriterBuilder

Struct SpecificSingleObjectWriterBuilder 

Source
pub struct SpecificSingleObjectWriterBuilder<T, S: State = Empty>
where T: AvroSchema,
{ /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<T, S: State> SpecificSingleObjectWriterBuilder<T, S>
where T: AvroSchema,

Source

pub fn build(self) -> SpecificSingleObjectWriter<T>
where S: IsComplete,

Finish building and return the requested object

Source

pub fn resolved( self, schema: Schema, ) -> Result<SpecificSingleObjectWriterBuilder<T, SetResolved<S>>, Error>
where S::Resolved: IsUnset,

Optional (Some / Option setters). Default:

ResolvedOwnedSchema::new(T::get_schema())
    .expect("AvroSchema implementation should create valid schemas")
Source

pub fn maybe_resolved( self, value: Option<Schema>, ) -> Result<SpecificSingleObjectWriterBuilder<T, SetResolved<S>>, Error>
where S::Resolved: IsUnset,

Optional (Some / Option setters). Default:

ResolvedOwnedSchema::new(T::get_schema())
    .expect("AvroSchema implementation should create valid schemas")
Source

pub fn header( self, header_builder: impl HeaderBuilder, ) -> SpecificSingleObjectWriterBuilder<T, SetHeader<S>>
where S::Header: IsUnset,

Optional (Some / Option setters). Default:

RabinFingerprintHeader::from_schema(resolved.get_root_schema())
    .build_header()
Source

pub fn maybe_header( self, value: Option<impl HeaderBuilder>, ) -> SpecificSingleObjectWriterBuilder<T, SetHeader<S>>
where S::Header: IsUnset,

Optional (Some / Option setters). Default:

RabinFingerprintHeader::from_schema(resolved.get_root_schema())
    .build_header()
Source

pub fn human_readable( self, value: bool, ) -> SpecificSingleObjectWriterBuilder<T, SetHumanReadable<S>>
where S::HumanReadable: IsUnset,

Optional (Some / Option setters). Default: is_human_readable().

Should Serialize implementations pick a human readable representation.

It is recommended to set this to false.

Source

pub fn maybe_human_readable( self, value: Option<bool>, ) -> SpecificSingleObjectWriterBuilder<T, SetHumanReadable<S>>
where S::HumanReadable: IsUnset,

Optional (Some / Option setters). Default: is_human_readable().

Should Serialize implementations pick a human readable representation.

It is recommended to set this to false.

Source

pub fn target_block_size( self, value: usize, ) -> SpecificSingleObjectWriterBuilder<T, 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.

Source

pub fn maybe_target_block_size( self, value: Option<usize>, ) -> SpecificSingleObjectWriterBuilder<T, 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.

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
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.