pub struct ProjectionFrontier { /* private fields */ }Expand description
An opaque, scoped projection visibility frontier.
V2 binds (database_id, history_incarnation, FrontierPosition). Comparison and
ProjectionFrontier::satisfies require equal scopes; a restore that
bumps the incarnation can never satisfy a pre-restore causal token.
Implementations§
Source§impl ProjectionFrontier
impl ProjectionFrontier
Sourcepub fn new(history_incarnation: u64, position: FrontierPosition) -> Self
pub fn new(history_incarnation: u64, position: FrontierPosition) -> Self
Builds an engine-local or legacy V1 frontier with no database scope.
Sourcepub fn new_scoped(
database_id: DatabaseId,
history_incarnation: u64,
position: FrontierPosition,
) -> Self
pub fn new_scoped( database_id: DatabaseId, history_incarnation: u64, position: FrontierPosition, ) -> Self
Builds a V2 frontier bound to one database and history incarnation.
Sourcepub fn from_bytes(bytes: Vec<u8>) -> Result<Self, FreshnessTokenError>
pub fn from_bytes(bytes: Vec<u8>) -> Result<Self, FreshnessTokenError>
Parses opaque frontier bytes produced by Self::as_bytes.
Sourcepub const fn database_id(&self) -> Option<DatabaseId>
pub const fn database_id(&self) -> Option<DatabaseId>
Database scope; absent only on legacy V1 frontiers.
Sourcepub fn commit_token(&self) -> Option<CommitToken>
pub fn commit_token(&self) -> Option<CommitToken>
Returns a token for an applied position without losing its scope.
Sourcepub const fn history_incarnation(&self) -> u64
pub const fn history_incarnation(&self) -> u64
History incarnation bound into the frontier.
Sourcepub const fn position(&self) -> FrontierPosition
pub const fn position(&self) -> FrontierPosition
Sequence position of the frontier (may be FrontierPosition::BeforeFirst).
Sourcepub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
Consumes the frontier and returns its opaque bytes.
Sourcepub fn satisfies(&self, required: &CommitToken) -> bool
pub fn satisfies(&self, required: &CommitToken) -> bool
Whether this frontier covers required under exactly the same scope.
Database, version-scope, or incarnation mismatch always fails closed.
Sourcepub fn lag_sequences(&self, head: &Self) -> Option<u64>
pub fn lag_sequences(&self, head: &Self) -> Option<u64>
Sequence distance from this frontier to head when both share an
database scope and incarnation and are sequenced.