Skip to main content

RemoteQueryRequest

Struct RemoteQueryRequest 

Source
pub struct RemoteQueryRequest { /* private fields */ }
Expand description

One complete remote invocation of a reusable validated plan.

Implementations§

Source§

impl RemoteQueryRequest

Source

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.

Source

pub fn encode(&self) -> Result<Vec<u8>, Diagnostic>

Encode exact canonical envelope bytes.

Source

pub fn decode(bytes: &[u8]) -> Result<Self, Diagnostic>

Decode one request envelope, rejecting unknown fields and formats.

Source

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.

Source

pub fn invocation( &self, plan: &QueryPlan, ) -> Result<QueryInvocation, Diagnostic>

Rebuild the validated invocation against the carried plan.

Source

pub const fn limits(&self) -> RemoteLimits

Return the caller budgets.

Source

pub fn nonce(&self) -> &str

Return the caller nonce echoed by the response.

Source

pub fn binds_advertisement( &self, advertisement: &RemoteCapabilities, ) -> Result<bool, Diagnostic>

Return whether this request binds the executor’s exact advertisement.

Source

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.

Source

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.

Source

pub const fn expires_at_unix_ms(&self) -> u64

Return the request’s exclusive absolute expiry timestamp.

Trait Implementations§

Source§

impl Clone for RemoteQueryRequest

Source§

fn clone(&self) -> RemoteQueryRequest

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for RemoteQueryRequest

Source§

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

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

impl<'de> Deserialize<'de> for RemoteQueryRequest

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for RemoteQueryRequest

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Serialize for RemoteQueryRequest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for RemoteQueryRequest

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.