pub struct SchemaSplitter<E, F> { /* private fields */ }Expand description
Splits a stream by schema.
Implementations§
Source§impl<E, F> SchemaSplitter<E, F>
impl<E, F> SchemaSplitter<E, F>
Sourcepub fn new(build_encoder: F, no_schema_behavior: NoSchemaBehavior) -> Self
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, F> Splitter<E> for SchemaSplitter<E, F>
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,
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 moreSource§fn sub_encoders<'a>(&'a mut self) -> impl Iterator<Item = &'a mut E>where
E: 'a,
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>where
F: RefUnwindSafe,
E: RefUnwindSafe,
impl<E, F> Send for SchemaSplitter<E, F>
impl<E, F> Sync for SchemaSplitter<E, F>
impl<E, F> Unpin for SchemaSplitter<E, F>
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> 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