Trait vector::sinks::util::batch::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.

Object Safety§

This trait is not object safe.

Implementors§