pub struct OrderRef<'a>(/* private fields */);Expand description
Lifetime-scoped read borrow of a cached order.
Returned by crate::cache::Cache::order. The borrow drops with the enclosing scope, which
makes any attempt to hold it across a cache mutation panic at runtime: a loud failure beats the
silent staleness that a stored clone would produce.
Method calls on the inner OrderAny resolve via Deref; comparisons against &OrderAny
or owned OrderAny values are direct (order_ref == &order); Display and Debug forward
to the inner record. Use cloned when an owned snapshot is required (for
example, before crossing a boundary that may dispatch events).
Implementations§
Methods from Deref<Target = OrderAny>§
Sourcepub fn init_event(&self) -> &OrderInitialized
pub fn init_event(&self) -> &OrderInitialized
Returns a reference to the crate::events::OrderInitialized event.
This is always the first event in the order’s event list (invariant).
§Panics
Panics if the first event is not OrderInitialized (violates invariant).
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for OrderRef<'a>
impl<'a> !RefUnwindSafe for OrderRef<'a>
impl<'a> !Send for OrderRef<'a>
impl<'a> !Sync for OrderRef<'a>
impl<'a> Unpin for OrderRef<'a>
impl<'a> UnsafeUnpin for OrderRef<'a>
impl<'a> !UnwindSafe for OrderRef<'a>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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