Skip to main content

ActionDescriptor

Struct ActionDescriptor 

Source
pub struct ActionDescriptor {
Show 16 fields pub address: ActionAddress, pub semantic_identity: Option<ResourceSemanticIdentity>, pub resource_kind: String, pub resource_label: String, pub action_label: String, pub keywords: Vec<String>, pub did: Option<String>, pub icon: Option<String>, pub description: Option<String>, pub state: ActionState, pub locus: ExecutionLocus, pub kind: OperationKind, pub contract: ActionContract, pub input: InputSpec, pub params: Vec<ActionParam>, pub view: Option<ResourceViewDescriptor>,
}
Expand description

One exported operation, as inert data: everything a caller needs to decide whether to perform it, nothing that could perform it — an ActionSpec’s closure never appears here or crosses a boundary, only the address does.

Fields§

§address: ActionAddress§semantic_identity: Option<ResourceSemanticIdentity>§resource_kind: String

The publishing resource’s stable kind tag (word_processor.section, files.entry), shared with the OS-wide type registry so the same kind means the same thing across apps.

§resource_label: String

The resource’s human label, as the app words it.

§action_label: String§keywords: Vec<String>

The other words people use for the action ([ActionSpec::keywords]), published with its label so every search ranks them as it ranks the label.

§did: Option<String>

What the action did, said after who did it ([ActionSpec::did]): the past-tense form its app declares, when it declares one.

§icon: Option<String>

The action’s own picture ([ActionSpec::icon]), by its Lucide name.

§description: Option<String>§state: ActionState

What the action’s row shows of the state it acts on (ActionSpec::state).

§locus: ExecutionLocus§kind: OperationKind§contract: ActionContract§input: InputSpec§params: Vec<ActionParam>

Canonical typed invocation surface. input remains the palette-facing projection for compatibility; headless callers use these parameters.

§view: Option<ResourceViewDescriptor>

The explicit resource view opened by this action. Mount actions and unrelated local view operations carry None.

Implementations§

Source§

impl ActionDescriptor

Source

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

What the action writes besides its own resource, as a reader is told it: None for an action that declares nothing else (ActionContract::effects).

Source

pub fn changes_only_a_document(&self) -> bool

Whether this action changes only a document: a document operation, or one carried out on another document than the one its resource is kept in (crate::ROUTED_CHANGE_TAG). Such an action reads none of the content its resource refers to.

Source

pub fn prompt_param(&self) -> Option<&str>

The parameter this action’s one line of typed text goes into, when it is a prompted action: what an agent or a host holding only the descriptor learns instead of assuming a name.

Source

pub fn domain_resource(&self) -> &str

The resource’s own id, not the transport alias the window published it under (ResourceSpec::domain_name): the address a directory row carries, resolved back to its alias where the window published one.

Source

pub fn entry_param(&self) -> Option<&str>

The parameter one line of typed text fills, when the action is a capture: it declares an entry (title: Text (entry)), what a person writes down from wherever they are and what a palette offers as “New task”, run with the line they typed.

Source

pub fn bind_prompt_text( &self, arguments: Map<String, Value>, ) -> Map<String, Value>

arguments as this action takes them. A text argument on the wire (InvokeArgument::Text) names no parameter and reaches a host as a lone PROMPTED_PARAM; it is moved under this action’s own prompt parameter. Anything else is returned as given.

Trait Implementations§

Source§

impl Clone for ActionDescriptor

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 ActionDescriptor

Source§

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

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

impl<'de> Deserialize<'de> for ActionDescriptor

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 Eq for ActionDescriptor

Source§

impl From<&ActionDescriptor> for PublishedAction

Source§

fn from(descriptor: &ActionDescriptor) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for ActionDescriptor

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 ActionDescriptor

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 ActionDescriptor

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