pub struct MemoryRegistry { /* private fields */ }Expand description
An in-memory 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.
Reclaiming rotates the retainer, so the prior holder can no longer settle.Source§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.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