pub struct RefsStatus {
pub want: Vec<RefsAt>,
pub have: Vec<RefsAt>,
}
Expand description
Track the status of RefsAt
within a given repository.
Fields§
§want: Vec<RefsAt>
The rad/sigrefs
was missing or it’s ahead of the local
rad/sigrefs
. We want it.
have: Vec<RefsAt>
The rad/sigrefs
has been seen before. We already have it.
Implementations§
Source§impl RefsStatus
impl RefsStatus
Sourcepub fn new<D: Store>(
rid: RepoId,
refs: NonEmpty<RefsAt>,
db: &D,
) -> Result<RefsStatus, Error>
pub fn new<D: Store>( rid: RepoId, refs: NonEmpty<RefsAt>, db: &D, ) -> Result<RefsStatus, Error>
Get the set of want
and have
RefsAt
’s for the given
announcement.
Nb. We use the refs database as a cache for quick lookups. This does not check for ancestry matches, since we don’t cache the whole history (only the tips). This, however, is not a problem because the signed refs branch is fast-forward only, and old refs announcements will be discarded due to their lower timestamps.
Trait Implementations§
Source§impl Default for RefsStatus
impl Default for RefsStatus
Source§fn default() -> RefsStatus
fn default() -> RefsStatus
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RefsStatus
impl RefUnwindSafe for RefsStatus
impl Send for RefsStatus
impl Sync for RefsStatus
impl Unpin for RefsStatus
impl UnwindSafe for RefsStatus
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
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more