Skip to main content

SchemaSplitter

Struct SchemaSplitter 

Source
pub struct SchemaSplitter<E, F> { /* private fields */ }
Expand description

Splits a stream by schema.

Implementations§

Source§

impl<E, F> SchemaSplitter<E, F>
where F: Fn(Schema, Option<Metadata>) -> Result<E>,

Source

pub fn new(build_encoder: F, no_schema_behavior: NoSchemaBehavior) -> Self

Creates a new splitter that will split the input stream by schema, creating a separate sub-encoder for each schema using build_encoder.

The no_schema_behavior determines how records with rtypes that don’t map to a schema (such as ErrorMsg) are handled.

Trait Implementations§

Source§

impl<E: Debug, F: Debug> Debug for SchemaSplitter<E, F>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<E, F> Splitter<E> for SchemaSplitter<E, F>

Source§

fn sub_encoder<R>( &mut self, metadata: Option<&Metadata>, record: &R, ) -> Result<Option<&mut E>>
where R: Record,

Returns the encoder for the given record, or None if the record should be ignored. Read more
Source§

fn sub_encoders<'a>(&'a mut self) -> impl Iterator<Item = &'a mut E>
where E: 'a,

Returns an iterator over all active sub-encoders.

Auto Trait Implementations§

§

impl<E, F> Freeze for SchemaSplitter<E, F>
where F: Freeze,

§

impl<E, F> RefUnwindSafe for SchemaSplitter<E, F>

§

impl<E, F> Send for SchemaSplitter<E, F>
where F: Send, E: Send,

§

impl<E, F> Sync for SchemaSplitter<E, F>
where F: Sync, E: Sync,

§

impl<E, F> Unpin for SchemaSplitter<E, F>
where F: Unpin, E: Unpin,

§

impl<E, F> UnsafeUnpin for SchemaSplitter<E, F>
where F: UnsafeUnpin,

§

impl<E, F> UnwindSafe for SchemaSplitter<E, F>
where F: UnwindSafe, E: 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, 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, 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.
Source§

impl<T> Ungil for T
where T: Send,