Skip to main content

InvokeRequest

Struct InvokeRequest 

Source
pub struct InvokeRequest {
    pub invocation: InvocationId,
    pub target: RemoteActionTarget,
    pub argument: InvokeArgument,
    pub context: Option<ActionContext>,
    pub confirmation: Option<Confirmation>,
    pub revision: Option<String>,
    pub on_behalf_of: Option<InvocationId>,
    pub wait_ms: Option<u32>,
    pub appearance: Option<Appearance>,
    pub signed: Option<Box<SignedInvocation>>,
}
Expand description

A request to run one published action.

Fields§

§invocation: InvocationId

Chosen by the caller and reused verbatim on retry; the provider runs the action at most once per id.

§target: RemoteActionTarget§argument: InvokeArgument§context: Option<ActionContext>

Human provenance carried into history. It never grants authority.

§confirmation: Option<Confirmation>

The caller’s explicit confirmation, for an action whose contract requires one. The provider checks it against the contract; it is evidence, not authority.

§revision: Option<String>

The catalogue revision the caller chose the target from, for a provider whose actions are resolved live at that revision. A provider refuses a target that no longer exists at it rather than guessing.

Omitted, a directory target resolves against the directory as it is now, and the admission is bound to the revision the provider resolved it at: an executing provider still refuses the action once the directory moved on before it ran. An action whose contract asks for confirmation needs the revision it was shown at; without one the provider refuses with CONFIRMED_ACTION_NEEDS_REVISION.

§on_behalf_of: Option<InvocationId>

The live invocation this request continues: an edit an effect submits while running for someone else. The provider admits it as that invocation’s original caller, with their grants, never as the app.

§wait_ms: Option<u32>

Hold the receipt until the invocation settles or this many milliseconds pass (at most MAX_REMOTE_WAIT), so a quick action answers in one round trip. How the answer travels, not what runs: serve takes it off the request before the provider sees it, and InvocationLog ignores it. A provider that predates it answers at admission, as before.

§appearance: Option<Appearance>

The name and avatar a bot asks to show for this action. Only an API that can check the caller is a bot allowed it admits one (the workspace-action API a bot drives); every other API refuses the request (crate::appearance::refuse_here) rather than dropping the field.

§signed: Option<Box<SignedInvocation>>

The caller’s own signature over who asks for which action on which resource with which arguments (SignedInvocation). A host that runs an invocation for a caller on another device requires it and acts as its verified signer; a request that never leaves its device (an app asking its own session) carries none.

A call an app makes while it runs someone’s invocation carries that invocation here instead, the one its Self::on_behalf_of names (SignedInvocation::serves): the original caller’s signature is its proof, and the device running the app signs the request that brings it.

Implementations§

Source§

impl InvokeRequest

Source

pub fn made_from(&self) -> Option<MadeFrom>

The resource this call is made from, as its caller named it in its arguments (crate::params::FROM_ARGUMENT): what the resources it makes are made from, and what a turn it starts answers. The dispatch admits a call made from a resource only for a caller who may read that resource.

Source

pub fn approval(&self) -> Option<&Approval>

The person’s approve of the asked record this call was kept as, when the dispatch admitted it again on their answer: what a provider that waits for their yes reads instead of asking.

Source

pub fn said_session_name(&self) -> Option<String>

What the agent’s harness calls the session this request was sent in (“Release prep”), as the client’s agent-session group says it: display only, the name people see the agent by (Caller::in_named_session). None when the client named no session.

Source

pub fn same_invocation(&self, other: &Self) -> bool

Whether other asks for the same invocation: every field but the transport-only wait_ms, so a retry that waits differently is still a retry.

Source

pub fn plain(target: RemoteActionTarget, arguments: Map<String, Value>) -> Self

An invocation of target with arguments and nothing else: no context, revision or signature, answered once it is admitted.

Trait Implementations§

Source§

impl Clone for InvokeRequest

Source§

fn clone(&self) -> Self

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 InvokeRequest

Source§

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

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

impl<'de> Deserialize<'de> for InvokeRequest

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 InvokeRequest

Source§

fn eq(&self, other: &Self) -> 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 InvokeRequest

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 InvokeRequest

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more