pub struct RemoteQueryRequest { /* private fields */ }Expand description
One complete remote invocation of a reusable validated plan.
Implementations§
Source§impl RemoteQueryRequest
impl RemoteQueryRequest
Sourcepub fn new(
plan: &QueryPlan,
invocation: &QueryInvocation,
advertisement: &RemoteCapabilities,
limits: RemoteLimits,
nonce: impl Into<String>,
prepared_at_unix_ms: u64,
) -> Result<Self, Diagnostic>
pub fn new( plan: &QueryPlan, invocation: &QueryInvocation, advertisement: &RemoteCapabilities, limits: RemoteLimits, nonce: impl Into<String>, prepared_at_unix_ms: u64, ) -> Result<Self, Diagnostic>
Bind one plan invocation and caller budgets into a request envelope.
Sourcepub fn decode(bytes: &[u8]) -> Result<Self, Diagnostic>
pub fn decode(bytes: &[u8]) -> Result<Self, Diagnostic>
Decode one request envelope, rejecting unknown fields and formats.
Sourcepub fn plan(&self) -> Result<QueryPlan, Diagnostic>
pub fn plan(&self) -> Result<QueryPlan, Diagnostic>
Rebuild the trusted plan from the embedded canonical document.
The embedded tree re-encodes to exact canonical bytes and runs the full plan wire decoder, so every structural plan check applies to remote plans exactly as it does to local ones.
Sourcepub fn invocation(
&self,
plan: &QueryPlan,
) -> Result<QueryInvocation, Diagnostic>
pub fn invocation( &self, plan: &QueryPlan, ) -> Result<QueryInvocation, Diagnostic>
Rebuild the validated invocation against the carried plan.
Sourcepub const fn limits(&self) -> RemoteLimits
pub const fn limits(&self) -> RemoteLimits
Return the caller budgets.
Sourcepub fn binds_advertisement(
&self,
advertisement: &RemoteCapabilities,
) -> Result<bool, Diagnostic>
pub fn binds_advertisement( &self, advertisement: &RemoteCapabilities, ) -> Result<bool, Diagnostic>
Return whether this request binds the executor’s exact advertisement.
Sourcepub fn remaining_lifetime_ms(&self, now_unix_ms: u64) -> Result<u64, Diagnostic>
pub fn remaining_lifetime_ms(&self, now_unix_ms: u64) -> Result<u64, Diagnostic>
Validate this request’s absolute lifetime at one executor clock sample.
Clients at most MAX_REMOTE_CLOCK_SKEW_MS ahead are accepted. The
expiry itself is exclusive: a request at or beyond it is rejected.
The returned duration reaches the absolute expiry and is the replay
retention horizon. It can exceed the declared execution duration by
the admitted positive clock skew; use Self::remaining_execution_ms
to bound execution itself.
Sourcepub fn remaining_execution_ms(
&self,
now_unix_ms: u64,
) -> Result<u64, Diagnostic>
pub fn remaining_execution_ms( &self, now_unix_ms: u64, ) -> Result<u64, Diagnostic>
Return the remaining execution duration without granting clock skew.
Positive skew can place absolute expiry later than now + declared duration. Execution therefore uses the smaller of the absolute
remaining horizon and the fingerprint-bound declared lifetime, while
replay retention continues through the full absolute horizon.
Sourcepub const fn expires_at_unix_ms(&self) -> u64
pub const fn expires_at_unix_ms(&self) -> u64
Return the request’s exclusive absolute expiry timestamp.
Trait Implementations§
Source§impl Clone for RemoteQueryRequest
impl Clone for RemoteQueryRequest
Source§fn clone(&self) -> RemoteQueryRequest
fn clone(&self) -> RemoteQueryRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more