#[non_exhaustive]pub struct CaptureSummary { /* private fields */ }Expand description
The outcome of an immediate capture (Client::capture_immediate /
Client::capture_batch_immediate), returned once the SDK has a terminal
result for the batch — the request succeeded, or the retry budget was spent
(which is an Err instead).
A returned CaptureSummary means the capture request itself succeeded (HTTP
2xx). On the capture-v1 pipeline the backend reports a per-event verdict,
so a 2xx can still leave some events unpersisted (drop/retry) — check
all_persisted / not_persisted
before treating the batch as fully durable. On the v0 pipeline a 2xx
persists the whole batch, so all_persisted() is always true.
#[non_exhaustive]: fields are read through accessors so more can be added
without breaking callers.
Implementations§
Source§impl CaptureSummary
impl CaptureSummary
Sourcepub fn submitted(&self) -> usize
pub fn submitted(&self) -> usize
Number of events sent on the wire (after before_send filtering).
Sourcepub fn not_persisted(&self) -> usize
pub fn not_persisted(&self) -> usize
Number of submitted events the backend did not persist.
Always 0 on the v0 pipeline (a 2xx persists the whole batch). On
capture-v1 this is submitted minus the events with an ok/warning
verdict, so it counts both drop/retry verdicts and any submitted
event the backend omitted from its response.
Sourcepub fn all_persisted(&self) -> bool
pub fn all_persisted(&self) -> bool
Whether every submitted event was persisted (not_persisted() == 0).
Note this is vacuously true when nothing was sent (submitted() == 0),
which is what a disabled client or a fully before_send-filtered batch
returns. Callers that advance durable state on the strength of an immediate
delivery (e.g. committing an upstream offset) must therefore also check
submitted() against the number of events they intended to send — do not
gate durability on all_persisted() alone.
Trait Implementations§
Source§impl Clone for CaptureSummary
impl Clone for CaptureSummary
Source§fn clone(&self) -> CaptureSummary
fn clone(&self) -> CaptureSummary
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more