pub struct ProjectionCursor { /* private fields */ }Expand description
Provider-tagged, provider-complete durable projection cursor.
The cursor owns the opaque source position and the deduplication set needed
by inclusive-resume providers. Self::encode and Self::decode form the
stable store-independent string codec used by durable backends.
Implementations§
Source§impl ProjectionCursor
impl ProjectionCursor
Sourcepub fn new(
provider_manifest: ProviderManifest,
boundary: DeduplicationBoundary,
) -> Self
pub fn new( provider_manifest: ProviderManifest, boundary: DeduplicationBoundary, ) -> Self
Creates a provider-complete cursor.
Sourcepub fn from_position(
provider_manifest: ProviderManifest,
position: impl Into<CursorPosition>,
) -> Self
pub fn from_position( provider_manifest: ProviderManifest, position: impl Into<CursorPosition>, ) -> Self
Creates a cursor with an empty deduplication set.
Sourcepub fn provider_manifest(&self) -> &ProviderManifest
pub fn provider_manifest(&self) -> &ProviderManifest
Returns the durable source-provider manifest.
Sourcepub fn position(&self) -> &CursorPosition
pub fn position(&self) -> &CursorPosition
Returns the provider-defined resume position.
Sourcepub fn boundary(&self) -> &DeduplicationBoundary
pub fn boundary(&self) -> &DeduplicationBoundary
Returns the complete inclusive-resume deduplication boundary.
Sourcepub fn ensure_manifest(
&self,
expected: &ProviderManifest,
) -> ProjectionResult<()>
pub fn ensure_manifest( &self, expected: &ProviderManifest, ) -> ProjectionResult<()>
Verifies that this cursor belongs to the configured source provider.
Sourcepub fn encode(&self) -> String
pub fn encode(&self) -> String
Encodes this cursor using Datum’s stable versioned string format.
Strings are UTF-8 encoded as lowercase hexadecimal and boundary events are ordered by persistence id then sequence number, so equal cursors always produce byte-for-byte equal output.
Sourcepub fn decode(encoded: &str) -> ProjectionResult<Self>
pub fn decode(encoded: &str) -> ProjectionResult<Self>
Decodes and validates Datum’s stable versioned string format.
Malformed, duplicate, out-of-order, or non-canonical data is a fatal cursor-codec error and must not enter projection restart backoff.