Struct ProjectionFrontier
pub struct ProjectionFrontier { /* private fields */ }Expand description
Freshness policy and commit token types used by projected queries. 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§
§impl ProjectionFrontier
impl ProjectionFrontier
pub fn new(
history_incarnation: u64,
position: FrontierPosition,
) -> ProjectionFrontier
pub fn new( history_incarnation: u64, position: FrontierPosition, ) -> ProjectionFrontier
Builds an engine-local or legacy V1 frontier with no database scope.
pub fn new_scoped(
database_id: DatabaseId,
history_incarnation: u64,
position: FrontierPosition,
) -> ProjectionFrontier
pub fn new_scoped( database_id: DatabaseId, history_incarnation: u64, position: FrontierPosition, ) -> ProjectionFrontier
Builds a V2 frontier bound to one database and history incarnation.
pub fn from_bytes(
bytes: Vec<u8>,
) -> Result<ProjectionFrontier, FreshnessTokenError>
pub fn from_bytes( bytes: Vec<u8>, ) -> Result<ProjectionFrontier, FreshnessTokenError>
Parses opaque frontier bytes produced by Self::as_bytes.
pub const fn database_id(&self) -> Option<DatabaseId>
pub const fn database_id(&self) -> Option<DatabaseId>
Database scope; absent only on legacy V1 frontiers.
pub fn commit_token(&self) -> Option<CommitToken>
pub fn commit_token(&self) -> Option<CommitToken>
Returns a token for an applied position without losing its scope.
pub const fn history_incarnation(&self) -> u64
pub const fn history_incarnation(&self) -> u64
History incarnation bound into the frontier.
pub const fn position(&self) -> FrontierPosition
pub const fn position(&self) -> FrontierPosition
Sequence position of the frontier (may be [FrontierPosition::BeforeFirst]).
pub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
Consumes the frontier and returns its opaque bytes.
pub 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.
pub fn lag_sequences(&self, head: &ProjectionFrontier) -> Option<u64>
pub fn lag_sequences(&self, head: &ProjectionFrontier) -> Option<u64>
Sequence distance from this frontier to head when both share an
database scope and incarnation and are sequenced.
Trait Implementations§
§impl Clone for ProjectionFrontier
impl Clone for ProjectionFrontier
§fn clone(&self) -> ProjectionFrontier
fn clone(&self) -> ProjectionFrontier
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ProjectionFrontier
impl Debug for ProjectionFrontier
impl Eq for ProjectionFrontier
§impl Hash for ProjectionFrontier
impl Hash for ProjectionFrontier
§impl Ord for ProjectionFrontier
impl Ord for ProjectionFrontier
§fn cmp(&self, other: &ProjectionFrontier) -> Ordering
fn cmp(&self, other: &ProjectionFrontier) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
§impl PartialEq for ProjectionFrontier
impl PartialEq for ProjectionFrontier
§fn eq(&self, other: &ProjectionFrontier) -> bool
fn eq(&self, other: &ProjectionFrontier) -> bool
self and other values to be equal, and is used by ==.§impl PartialOrd for ProjectionFrontier
impl PartialOrd for ProjectionFrontier
Auto Trait Implementations§
impl Freeze for ProjectionFrontier
impl RefUnwindSafe for ProjectionFrontier
impl Send for ProjectionFrontier
impl Sync for ProjectionFrontier
impl Unpin for ProjectionFrontier
impl UnsafeUnpin for ProjectionFrontier
impl UnwindSafe for ProjectionFrontier
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].