pub struct BillingPipeline<E> { /* private fields */ }Expand description
Coordinates a UsageBuffer with an off-path exporter.
Implementations§
Source§impl<E> BillingPipeline<E>
impl<E> BillingPipeline<E>
Sourcepub fn new(exporter: E) -> Self
pub fn new(exporter: E) -> Self
Construct a pipeline with the default bounded deduplication store.
Sourcepub fn with_idempotency_capacity(exporter: E, capacity: usize) -> Self
pub fn with_idempotency_capacity(exporter: E, capacity: usize) -> Self
Construct a pipeline with an explicit idempotency-key bound.
Sourcepub fn pending_buckets(&self) -> usize
pub fn pending_buckets(&self) -> usize
Number of buffered aggregate buckets.
Source§impl<E: BatchExporter> BillingPipeline<E>
impl<E: BatchExporter> BillingPipeline<E>
Sourcepub async fn flush(&self) -> Result<usize, ExportError>
pub async fn flush(&self) -> Result<usize, ExportError>
Drain and export one batch. Failed batches retain their exact identifiers for an idempotent retry.
§Errors
Returns ExportError::FlushInProgress for overlapping flushes, or the
provider error after restoring the batch for retry.
Trait Implementations§
Source§impl<E> Debug for BillingPipeline<E>
impl<E> Debug for BillingPipeline<E>
Source§impl<E: BatchExporter> UsageRecorder for BillingPipeline<E>
impl<E: BatchExporter> UsageRecorder for BillingPipeline<E>
Source§fn record(&self, event: UsageEvent) -> Result<RecordOutcome, RecordError>
fn record(&self, event: UsageEvent) -> Result<RecordOutcome, RecordError>
Add one event without performing I/O. Read more
Auto Trait Implementations§
impl<E> !Freeze for BillingPipeline<E>
impl<E> RefUnwindSafe for BillingPipeline<E>where
E: RefUnwindSafe,
impl<E> Send for BillingPipeline<E>where
E: Send,
impl<E> Sync for BillingPipeline<E>where
E: Sync,
impl<E> Unpin for BillingPipeline<E>where
E: Unpin,
impl<E> UnsafeUnpin for BillingPipeline<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for BillingPipeline<E>where
E: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more