Skip to main content

TtlReachability

Struct TtlReachability 

Source
pub struct TtlReachability { /* private fields */ }
Expand description

The default: proofs live for lag_ms, in a table of at most max_entries rows. A rewind or ref deletion is therefore visible within the configured reachability_lag; only Reachability::invalidate forgets one sooner.

Implementations§

Source§

impl TtlReachability

Source

pub fn new(lag_ms: u64, max_entries: usize) -> Self

A cache whose rows expire lag_ms after they are recorded.

Trait Implementations§

Source§

impl Debug for TtlReachability

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Reachability for TtlReachability

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> MaybeSend for T
where T: Send + ?Sized,

Source§

impl<T> MaybeSync for T
where T: Sync + ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more