Skip to main content

ReclaimGrant

Struct ReclaimGrant 

Source
#[non_exhaustive]
pub struct ReclaimGrant { pub execution_id: ExecutionId, pub partition_key: PartitionKey, pub grant_key: String, pub expires_at_ms: u64, pub lane_id: LaneId, }
Expand description

A lease-reclaim grant issued for an execution in lease_expired_reclaimable or lease_revoked state (RFC-024 §3.1).

Distinct from ResumeGrant: the reclaim grant routes to ff_reclaim_execution (Valkey) / the new-attempt reclaim impl (PG/SQLite), which creates a NEW attempt row and bumps the execution’s lease_reclaim_count. The resume grant, by contrast, re-uses the existing attempt under ff_claim_resumed_execution.

Carries lane_id for symmetry with ResumeGrant — the Lua ff_reclaim_execution needs the lane for key construction, and the consuming worker would otherwise pay a round-trip to recover it from exec_core.

Backend impl bodies ship under PR-D (PG) / PR-E (SQLite) / PR-F (Valkey). This PR lands only the type + trait surface; default crate::engine_backend::EngineBackend::issue_reclaim_grant and crate::engine_backend::EngineBackend::reclaim_execution return crate::engine_error::EngineError::Unavailable until each backend PR wires its real body.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§execution_id: ExecutionId

The execution granted for lease-reclaim.

§partition_key: PartitionKey

Opaque partition handle for this execution’s hash-tag slot.

§grant_key: String

Backend-scoped grant key (Valkey key / PG+SQLite ff_claim_grant.grant_id).

§expires_at_ms: u64

Monotonic ms when the grant expires; unconsumed grants vanish.

§lane_id: LaneId

Lane the execution belongs to — needed by ff_reclaim_execution for KEYS[*] construction.

Implementations§

Source§

impl ReclaimGrant

Source

pub fn new( execution_id: ExecutionId, partition_key: PartitionKey, grant_key: String, expires_at_ms: u64, lane_id: LaneId, ) -> Self

Construct a reclaim grant. Added alongside #[non_exhaustive] per RFC-024 §3.1 + feedback_non_exhaustive_needs_constructor.

Source

pub fn partition(&self) -> Result<Partition, PartitionKeyParseError>

Parse partition_key into a typed crate::partition::Partition.

Trait Implementations§

Source§

impl Clone for ReclaimGrant

Source§

fn clone(&self) -> ReclaimGrant

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ReclaimGrant

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ReclaimGrant

Source§

fn eq(&self, other: &ReclaimGrant) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for ReclaimGrant

Source§

impl StructuralPartialEq for ReclaimGrant

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.