pub struct MemoryRegistry { /* private fields */ }Expand description
An in-memory synchronous registry seeded with a fixed set of pacts.
Implementations§
Trait Implementations§
Source§impl Registry for MemoryRegistry
impl Registry for MemoryRegistry
Source§fn claim(
&self,
dockets: &[&str],
now: Timestamp,
) -> Result<Option<Claim>, Self::Error>
fn claim( &self, dockets: &[&str], now: Timestamp, ) -> Result<Option<Claim>, Self::Error>
Claim a pact for execution from one of the requested dockets, using
now
to set the new lease and to reclaim any pact whose lease already expired
without settlement — a lapse, realized through this normal claim path. Read moreSource§fn lease_millis(&self) -> u64
fn lease_millis(&self) -> u64
The backend’s lease duration in milliseconds, used by
heartbeat
to compute the extended lease. Lease sizing is the backend’s; the contract supplies the
mechanism, not a constant.Source§fn apply(
&self,
retainer: &Retainer,
transition: &Transition<'_>,
) -> Result<(), Self::Error>
fn apply( &self, retainer: &Retainer, transition: &Transition<'_>, ) -> Result<(), Self::Error>
Apply a lifecycle transition to the pact held by
retainer, within the backend’s own
atomic scope. transition is the pure kernel decision (a lifecycle on_X): the
backend loads the held state, computes the next state through transition, and applies
it atomically — it never decides the transition itself, so the lifecycle semantics stay
single-sourced in the kernel and cannot drift. A transition applied against a pact the
retainer no longer holds resolves to a not-current-holder error (the kernel’s
NotCurrentHolder surfaces through transition). This is
the one transition port; the four transition operations below are provided over it. Read moreSource§fn heartbeat(
&self,
retainer: &Retainer,
now: Timestamp,
) -> Result<(), Self::Error>
fn heartbeat( &self, retainer: &Retainer, now: Timestamp, ) -> Result<(), Self::Error>
Extend the retainer’s lease using
now. A heartbeat presented after the
lease already expired is rejected: the holder must claim again rather than
revive a lapsed lease, so two holders never both hold settlement authority.Source§fn fulfill(&self, retainer: &Retainer) -> Result<(), Self::Error>
fn fulfill(&self, retainer: &Retainer) -> Result<(), Self::Error>
Mark the pact as successfully fulfilled. Rejected when the retainer is not
the current holder.
Auto Trait Implementations§
impl !Freeze for MemoryRegistry
impl RefUnwindSafe for MemoryRegistry
impl Send for MemoryRegistry
impl Sync for MemoryRegistry
impl Unpin for MemoryRegistry
impl UnsafeUnpin for MemoryRegistry
impl UnwindSafe for MemoryRegistry
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