pub enum Observed {
Nothing,
Value(RefTarget),
Unreadable(String),
}Expand description
The typed ref rejection, re-exported so a consumer of this crate reaches it
without also naming the contract crate. RefRejection::of(&err) is the only
sanctioned way to ask whether a ref write lost a race — never a message.
What was actually there — including the case where something was there
and could not be decoded.
Restored from gunnar-store’s deleted Error type, and the three-state is
the point. The two call sites that produce it in the gix arm used to write
from_gix_target(actual).ok(), which turned a reference that existed and
could not be read into None — reported to the pushing client as “nothing
was there”. A backend that reports no observed value for a rejection
answers Observed::Nothing, which is “the honest answer rather than a
dropped one”, and a backend that found bytes it could not parse answers
Observed::Unreadable. Collapsing those two is the defect this enum
exists to make impossible.
Variants§
Nothing
The ref did not exist.
Value(RefTarget)
It existed and held this.
Unreadable(String)
It existed, and the backend could not decode what it held.
Implementations§
Trait Implementations§
impl Eq for Observed
impl StructuralPartialEq for Observed
Auto Trait Implementations§
impl Freeze for Observed
impl RefUnwindSafe for Observed
impl Send for Observed
impl Sync for Observed
impl Unpin for Observed
impl UnsafeUnpin for Observed
impl UnwindSafe for Observed
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.