Skip to main content

BatcherBuilder

Struct BatcherBuilder 

Source
pub struct BatcherBuilder<P: Processor, I1, S: State = Empty>
where I1: Into<String>,
{ /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<P: Processor, I1, S: State> BatcherBuilder<P, I1, S>
where I1: Into<String>,

Source

pub fn build(self) -> Batcher<P>
where S: IsComplete,

Finishes building and performs the requested action.

Source

pub fn name(self, value: I1) -> BatcherBuilder<P, I1, SetName<S>>
where S::Name: IsUnset,

Required.

Identifies the batcher in tracing spans and logs, and is passed to the MetricsRecorderFactory.

Source

pub fn processor(self, value: P) -> BatcherBuilder<P, I1, SetProcessor<S>>
where S::Processor: IsUnset,

Required.

Source

pub fn limits(self, value: Limits) -> BatcherBuilder<P, I1, SetLimits<S>>
where S::Limits: IsUnset,

Required.

Source

pub fn batching_policy( self, value: BatchingPolicy, ) -> BatcherBuilder<P, I1, SetBatchingPolicy<S>>
where S::BatchingPolicy: IsUnset,

Required.

Source

pub fn metrics( self, value: Box<dyn MetricsRecorderFactory>, ) -> BatcherBuilder<P, I1, SetMetrics<S>>
where S::Metrics: IsUnset,

Optional (Some / Option setters).

Creates the batcher’s MetricsRecorder. Without it, no metrics are recorded.

Source

pub fn maybe_metrics( self, value: Option<Box<dyn MetricsRecorderFactory>>, ) -> BatcherBuilder<P, I1, SetMetrics<S>>
where S::Metrics: IsUnset,

Optional (Some / Option setters).

Creates the batcher’s MetricsRecorder. Without it, no metrics are recorded.

Auto Trait Implementations§

§

impl<P, I1, S = Empty> !RefUnwindSafe for BatcherBuilder<P, I1, S>

§

impl<P, I1, S = Empty> !UnwindSafe for BatcherBuilder<P, I1, S>

§

impl<P, I1, S> Forget for BatcherBuilder<P, I1, S>

§

impl<P, I1, S> Freeze for BatcherBuilder<P, I1, S>

§

impl<P, I1, S> Send for BatcherBuilder<P, I1, S>

§

impl<P, I1, S> Sync for BatcherBuilder<P, I1, S>

§

impl<P, I1, S> Unpin for BatcherBuilder<P, I1, S>

§

impl<P, I1, S> UnsafeUnpin for BatcherBuilder<P, I1, S>

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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> 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