#[non_exhaustive]pub struct ClaimGrant {
pub execution_id: ExecutionId,
pub partition_key: PartitionKey,
pub grant_key: String,
pub expires_at_ms: u64,
}Expand description
A claim grant issued by the scheduler for a specific execution.
The worker uses this to call ff_claim_execution (or
ff_acquire_lease), which atomically consumes the grant and
creates the lease.
Shared wire-level type between ff-scheduler (issuer) and
ff-sdk (consumer, via FlowFabricWorker::claim_from_grant).
Lives in ff-core so neither crate needs a dep on the other.
Lane asymmetry with ResumeGrant: ClaimGrant does NOT
carry lane_id. The issuing scheduler’s caller already picked
a lane (that’s how admission reached this grant) and passes it
through to claim_from_grant as a separate argument. The grant
handle stays narrow to what uniquely identifies the admission
decision. The matching field on ResumeGrant is an
intentional divergence — see the note on that type.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.execution_id: ExecutionIdThe execution that was granted.
partition_key: PartitionKeyOpaque partition handle for this execution’s hash-tag slot.
Public wire type: consumers pass it back to FlowFabric but
must not parse the interior hash tag for routing decisions.
Internal consumers that need the typed
crate::partition::Partition call Self::partition.
grant_key: StringThe Valkey key holding the grant hash (for the worker to reference).
expires_at_ms: u64When the grant expires if not consumed.
Implementations§
Source§impl ClaimGrant
impl ClaimGrant
Sourcepub fn new(
execution_id: ExecutionId,
partition_key: PartitionKey,
grant_key: String,
expires_at_ms: u64,
) -> Self
pub fn new( execution_id: ExecutionId, partition_key: PartitionKey, grant_key: String, expires_at_ms: u64, ) -> Self
Construct a fresh-claim grant. Added alongside #[non_exhaustive]
per RFC-024 §3.1 + feedback_non_exhaustive_needs_constructor.
Sourcepub fn partition(&self) -> Result<Partition, PartitionKeyParseError>
pub fn partition(&self) -> Result<Partition, PartitionKeyParseError>
Parse partition_key into a typed
crate::partition::Partition. Intended for internal
consumers (scheduler emitter, SDK worker claim path) that
need the family/index pair. Fails only on malformed keys
(which indicates a producer bug).
Alias collapse applies: a grant issued against Execution
family round-trips to Flow (see crate::partition::PartitionKey
for the rationale — routing is preserved, only the metadata
family label normalises).
Trait Implementations§
Source§impl Clone for ClaimGrant
impl Clone for ClaimGrant
Source§fn clone(&self) -> ClaimGrant
fn clone(&self) -> ClaimGrant
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more