Struct ClaimRequest
pub struct ClaimRequest {
pub target: ClaimTarget,
pub worker: WorkerId,
pub heartbeat_millis: u64,
pub params: Vec<ParamWrite>,
pub state: Option<(Scope, StateBlob)>,
pub operation: OperationId,
}Expand description
Input to an atomic claim.
Fields§
§target: ClaimTargetThe reserved or paused trial to claim.
worker: WorkerIdThe worker taking ownership.
heartbeat_millis: u64The caller’s initial heartbeat timestamp.
params: Vec<ParamWrite>Parameters to write as part of the claim.
state: Option<(Scope, StateBlob)>An optional trial-keyed state blob to write as part of the claim.
operation: OperationIdThe lifecycle operation this call belongs to, for cross-process
correlation. OperationId::NONE when the caller has none — an honest
gap, never a fabricated correlation.
Implementations§
§impl ClaimRequest
impl ClaimRequest
pub const fn new(
target: ClaimTarget,
worker: WorkerId,
heartbeat_millis: u64,
) -> Self
pub const fn new( target: ClaimTarget, worker: WorkerId, heartbeat_millis: u64, ) -> Self
Creates a claim with no initial parameters or state.
pub fn with_params(self, params: Vec<ParamWrite>) -> Self
pub fn with_params(self, params: Vec<ParamWrite>) -> Self
Adds the initial parameter batch.
pub fn with_state(self, scope: Scope, blob: StateBlob) -> Self
pub fn with_state(self, scope: Scope, blob: StateBlob) -> Self
Adds one initial trial-keyed state write.
pub const fn with_operation(self, operation: OperationId) -> Self
pub const fn with_operation(self, operation: OperationId) -> Self
Tags the request with the lifecycle operation it belongs to.
Defaulted rather than required: a backend must work for a caller with no correlation to offer, and a required id would only ever be satisfied with a fresh one that correlates nothing.
Trait Implementations§
§impl Clone for ClaimRequest
impl Clone for ClaimRequest
§fn clone(&self) -> ClaimRequest
fn clone(&self) -> ClaimRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more