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).