pub enum Entry {
NotFound,
Object(Metadata, Bytes),
Tombstone(Tombstone),
}Expand description
Type returned by InMemoryBackend::get for direct inspection of stored entries.
Variants§
NotFound
No entry exists at this key.
Object(Metadata, Bytes)
A real object with its metadata and payload bytes.
Tombstone(Tombstone)
A redirect tombstone indicating the real object lives in the long-term backend.
Implementations§
Source§impl Entry
impl Entry
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Returns true if the entry is Entry::NotFound.
Sourcepub fn is_object(&self) -> bool
pub fn is_object(&self) -> bool
Returns true if the entry is Entry::Object.
Sourcepub fn is_tombstone(&self) -> bool
pub fn is_tombstone(&self) -> bool
Returns true if the entry is Entry::Tombstone.
Sourcepub fn expect_not_found(&self)
pub fn expect_not_found(&self)
Panics unless the entry is Entry::NotFound.
Sourcepub fn expect_object(&self) -> (Metadata, Bytes)
pub fn expect_object(&self) -> (Metadata, Bytes)
Returns the metadata and payload bytes, panicking if the entry is not Entry::Object.
Sourcepub fn expect_tombstone(&self) -> Tombstone
pub fn expect_tombstone(&self) -> Tombstone
Returns the tombstone, panicking if the entry is not Entry::Tombstone.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Entry
impl RefUnwindSafe for Entry
impl Send for Entry
impl Sync for Entry
impl Unpin for Entry
impl UnwindSafe for Entry
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
Wrap the input message
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>,
Applies the layer to a service and wraps it in [
Layered].