Skip to main content

cloud_sdk/transport/streaming/
completion.rs

1//! Successful streaming completion metadata.
2
3use super::{StreamProgress, StreamSinkMode};
4
5/// Successful accounting completion.
6#[derive(Clone, Copy, Debug, Eq, PartialEq)]
7pub struct StreamCompletion {
8    pub(super) progress: StreamProgress,
9    pub(super) sink_mode: StreamSinkMode,
10}
11
12impl StreamCompletion {
13    /// Returns final actual counters.
14    #[must_use]
15    pub const fn progress(self) -> StreamProgress {
16        self.progress
17    }
18
19    /// Reports whether the sink must commit its hidden transactional state.
20    #[must_use]
21    pub const fn requires_sink_commit(self) -> bool {
22        matches!(self.sink_mode, StreamSinkMode::Transactional)
23    }
24}