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: StringThe 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: StringThe 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: ActionStateWhat 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
impl ActionDescriptor
Sourcepub fn writes(&self) -> Option<String>
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).
Sourcepub fn changes_only_a_document(&self) -> bool
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.
Sourcepub fn prompt_param(&self) -> Option<&str>
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.
Sourcepub fn domain_resource(&self) -> &str
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.
Sourcepub fn entry_param(&self) -> Option<&str>
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.
Sourcepub fn bind_prompt_text(
&self,
arguments: Map<String, Value>,
) -> Map<String, Value>
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
impl Clone for ActionDescriptor
Source§impl Debug for ActionDescriptor
impl Debug for ActionDescriptor
Source§impl<'de> Deserialize<'de> for ActionDescriptor
impl<'de> Deserialize<'de> for ActionDescriptor
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ActionDescriptor
Source§impl From<&ActionDescriptor> for PublishedAction
impl From<&ActionDescriptor> for PublishedAction
Source§fn from(descriptor: &ActionDescriptor) -> Self
fn from(descriptor: &ActionDescriptor) -> Self
Source§impl PartialEq for ActionDescriptor
impl PartialEq for ActionDescriptor
Source§impl Serialize for ActionDescriptor
impl Serialize for ActionDescriptor
impl StructuralPartialEq for ActionDescriptor
Auto Trait Implementations§
impl Forget for ActionDescriptor
impl Freeze for ActionDescriptor
impl Move for ActionDescriptor
impl RefUnwindSafe for ActionDescriptor
impl Send for ActionDescriptor
impl Sync for ActionDescriptor
impl Unpin for ActionDescriptor
impl UnsafeUnpin for ActionDescriptor
impl UnwindSafe for ActionDescriptor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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