pub struct ManifestWriter<'a, W>(/* private fields */)
where
    W: Write;
Expand description

A writer for manifest entries

Implementations§

source§

impl<'a, W> ManifestWriter<'a, W>
where W: Write,

source

pub fn new( writer: W, schema: &'a Schema, table_metadata: &TableMetadata, branch: Option<&str> ) -> Result<ManifestWriter<'a, W>, Error>

source

pub fn into_inner(self) -> Result<W, Error>

Methods from Deref<Target = Writer<'a, W>>§

source

pub fn schema(&self) -> &'a Schema

Get a reference to the Schema associated to a Writer.

source

pub fn append<T>(&mut self, value: T) -> Result<usize, Error>
where T: Into<Value>,

Append a compatible value (implementing the ToAvro trait) to a Writer, also performing schema validation.

Return the number of bytes written (it might be 0, see below).

NOTE This function is not guaranteed to perform any actual write, since it relies on internal buffering for performance reasons. If you want to be sure the value has been written, then call flush.

source

pub fn append_value_ref(&mut self, value: &Value) -> Result<usize, Error>

Append a compatible value to a Writer, also performing schema validation.

Return the number of bytes written (it might be 0, see below).

NOTE This function is not guaranteed to perform any actual write, since it relies on internal buffering for performance reasons. If you want to be sure the value has been written, then call flush.

source

pub fn append_ser<S>(&mut self, value: S) -> Result<usize, Error>
where S: Serialize,

Append anything implementing the Serialize trait to a Writer for serde compatibility, also performing schema validation.

Return the number of bytes written.

NOTE This function is not guaranteed to perform any actual write, since it relies on internal buffering for performance reasons. If you want to be sure the value has been written, then call flush.

source

pub fn extend<I, T>(&mut self, values: I) -> Result<usize, Error>
where T: Into<Value>, I: IntoIterator<Item = T>,

Extend a Writer with an Iterator of compatible values (implementing the ToAvro trait), also performing schema validation.

Return the number of bytes written.

NOTE This function forces the written data to be flushed (an implicit call to flush is performed).

source

pub fn extend_ser<I, T>(&mut self, values: I) -> Result<usize, Error>
where T: Serialize, I: IntoIterator<Item = T>,

Extend a Writer with an Iterator of anything implementing the Serialize trait for serde compatibility, also performing schema validation.

Return the number of bytes written.

NOTE This function forces the written data to be flushed (an implicit call to flush is performed).

source

pub fn extend_from_slice(&mut self, values: &[Value]) -> Result<usize, Error>

Extend a Writer by appending each Value from a slice, while also performing schema validation on each value appended.

Return the number of bytes written.

NOTE This function forces the written data to be flushed (an implicit call to flush is performed).

source

pub fn flush(&mut self) -> Result<usize, Error>

Flush the content appended to a Writer. Call this function to make sure all the content has been written before releasing the Writer.

Return the number of bytes written.

source

pub fn add_user_metadata<T>( &mut self, key: String, value: T ) -> Result<(), Error>
where T: AsRef<[u8]>,

Adds custom metadata to the file. This method could be used only before adding the first record to the writer.

Trait Implementations§

source§

impl<'a, W> Deref for ManifestWriter<'a, W>
where W: Write,

§

type Target = Writer<'a, W>

The resulting type after dereferencing.
source§

fn deref(&self) -> &<ManifestWriter<'a, W> as Deref>::Target

Dereferences the value.
source§

impl<'a, W> DerefMut for ManifestWriter<'a, W>
where W: Write,

source§

fn deref_mut(&mut self) -> &mut <ManifestWriter<'a, W> as Deref>::Target

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'a, W> Freeze for ManifestWriter<'a, W>
where W: Freeze,

§

impl<'a, W> RefUnwindSafe for ManifestWriter<'a, W>
where W: RefUnwindSafe,

§

impl<'a, W> Send for ManifestWriter<'a, W>
where W: Send,

§

impl<'a, W> Sync for ManifestWriter<'a, W>
where W: Sync,

§

impl<'a, W> Unpin for ManifestWriter<'a, W>
where W: Unpin,

§

impl<'a, W> UnwindSafe for ManifestWriter<'a, W>
where W: UnwindSafe,

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

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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.
source§

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

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,