pub struct Builder<T, S> { /* private fields */ }
Expand description

Builder allows you to override various default parameter values before creating an instance of the desired Metric Sink.

Implementations§

source§

impl<T, S> Builder<T, S>

source

pub fn queue_cap(&mut self, queue_cap: usize) -> &mut Self

Sets the maximum metric queue capacity (default: DEFAULT_QUEUE_CAPACITY).

source

pub fn buf_size(&mut self, buf_size: usize) -> &mut Self

Sets the batch buffer size (default: DEFAULT_BATCH_BUF_SIZE).

source

pub fn max_delay(&mut self, max_delay: Duration) -> &mut Self

Sets the maximum delay before flushing any buffered metrics (default: DEFAULT_MAX_BATCH_DELAY).

source§

impl<T: ToSocketAddrs> Builder<T, UdpSocket>

source

pub fn build( self ) -> MetricResult<(TokioBatchUdpMetricSink, Pin<Box<dyn Future<Output = ()> + Send + Sync + 'static>>)>

Creates a customized instance of the TokioBatchUdpMetricSink.

§Errors

Returns an error when unable to resolve the configured host address, or when the configured queue capacity is 0.

source§

impl<T: AsRef<Path> + Send + Sync + Unpin + 'static> Builder<T, UnixDatagram>

source

pub fn build( self ) -> MetricResult<(TokioBatchUnixMetricSink, Pin<Box<dyn Future<Output = ()> + Send + Sync + 'static>>)>

Creates a customized instance of the TokioBatchUnixMetricSink.

§Errors

Returns an error when the configured queue capacity is 0.

Trait Implementations§

source§

impl<T: Debug, S: Debug> Debug for Builder<T, S>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T, S> RefUnwindSafe for Builder<T, S>

§

impl<T, S> Send for Builder<T, S>
where S: Send, T: Send,

§

impl<T, S> Sync for Builder<T, S>
where S: Sync, T: Sync,

§

impl<T, S> Unpin for Builder<T, S>
where S: Unpin, T: Unpin,

§

impl<T, S> UnwindSafe for Builder<T, S>
where S: UnwindSafe, T: 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>,

§

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

§

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.