Skip to main content

Reachability

Trait Reachability 

Source
pub trait Reachability: MaybeSend + MaybeSync {
    // Required methods
    fn known_reachable<'a>(
        &'a self,
        repo: &'a RepoId,
        id: &'a Hash,
        now_ms: u64,
    ) -> BoxFuture<'a, Result<bool, ServerError>>;
    fn record(&self, repo: &RepoId, id: &Hash, now_ms: u64);
    fn invalidate(&self, repo: &RepoId);
}
Expand description

A source of positive reachability answers, consulted before the walk.

Required Methods§

Source

fn known_reachable<'a>( &'a self, repo: &'a RepoId, id: &'a Hash, now_ms: u64, ) -> BoxFuture<'a, Result<bool, ServerError>>

Whether id is already known to be reachable from a published ref of repo as of now_ms. false means unknown, never unreachable. A positive answer skips the walk, so it also skips the walk’s takedown stop predicate: TakedownGate::check must therefore refuse a leaf that only a blocked or tombstoned manifest reaches.

Source

fn record(&self, repo: &RepoId, id: &Hash, now_ms: u64)

Record a proof: a walk found id, or a ref-path serve resolved it.

Source

fn invalidate(&self, repo: &RepoId)

Forget every proof of repo: a takedown, suspension or visibility change (WP-5.9a) that cannot wait out the lag calls it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§