vector::sinks::util::batch

Trait Batch

Source
pub trait Batch: Sized {
    type Input;
    type Output;

    // Required methods
    fn push(&mut self, item: Self::Input) -> PushResult<Self::Input>;
    fn is_empty(&self) -> bool;
    fn fresh(&self) -> Self;
    fn finish(self) -> Self::Output;
    fn num_items(&self) -> usize;

    // Provided method
    fn get_settings_defaults<D: SinkBatchSettings + Clone>(
        config: BatchConfig<D, Merged>,
    ) -> Result<BatchConfig<D, Merged>, BatchError> { ... }
}

Required Associated Types§

Required Methods§

Source

fn push(&mut self, item: Self::Input) -> PushResult<Self::Input>

Source

fn is_empty(&self) -> bool

Source

fn fresh(&self) -> Self

Source

fn finish(self) -> Self::Output

Source

fn num_items(&self) -> usize

Provided Methods§

Source

fn get_settings_defaults<D: SinkBatchSettings + Clone>( config: BatchConfig<D, Merged>, ) -> Result<BatchConfig<D, Merged>, BatchError>

Turn the batch configuration into an actualized set of settings, and deal with the proper behavior of max_size and if max_bytes may be set. This is in the trait to ensure all batch buffers implement it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§