Skip to main content

Module intent

Module intent 

Source
Expand description

Runtime intents dispatched by shortcuts and programmatic callers.

An Intent is the unit of “something wants to happen” in the action system. It pairs a stable name (the intent string) with an optional type-erased payload that handlers downcast when they recognize the intent. Intents are produced by Shortcuts at activation time, by widgets via ctx.send_intent, or by programmatic callers.

They dispatch through the widget tree by walking source-widget → root: each ancestor’s Action whose intent name matches gets a chance to consume the intent or propagate it.

§Typed DTOs via IntentKind

Apps that want typo-safe construction and handler-side exhaustiveness define an enum and implement IntentKind (by hand or via #[derive(IntentKind)] from teksilo-macros). The whole variant — including any fields it carries — is stored as the intent’s payload; handlers recover it via Intent::payload or IntentKind::from_intent.

Structs§

Intent
A runtime intent dispatched through the widget tree.

Enums§

IntentResponse
Return value of an Action handler. Controls whether the intent keeps bubbling up to ancestor widgets.

Traits§

IntentKind
Typed DTO bridge between an app’s intent enum and the runtime Intent dispatch type.