Struct tokio_cadence::builder::Builder[][src]

pub struct Builder<T, S> { /* fields omitted */ }

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

Implementations

impl<T, S> Builder<T, S>[src]

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

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

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

Sets the batch buffer size (default: DEFAULT_BATCH_BUF_SIZE).

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

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

impl<T: ToSocketAddrs> Builder<T, UdpSocket>[src]

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

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.

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

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

Creates a customized instance of the TokioBatchUnixMetricSink.

Errors

Returns an error when the configured queue capacity is 0.

Trait Implementations

impl<T: Debug, S: Debug> Debug for Builder<T, S>[src]

Auto Trait Implementations

impl<T, S> RefUnwindSafe for Builder<T, S> where
    S: RefUnwindSafe,
    T: RefUnwindSafe
[src]

impl<T, S> Send for Builder<T, S> where
    S: Send,
    T: Send
[src]

impl<T, S> Sync for Builder<T, S> where
    S: Sync,
    T: Sync
[src]

impl<T, S> Unpin for Builder<T, S> where
    S: Unpin,
    T: Unpin
[src]

impl<T, S> UnwindSafe for Builder<T, S> where
    S: UnwindSafe,
    T: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.