API reference

aster_ui::plugins

Pre-1.0: signatures are not frozen. Generated from rustdoc JSON of the compiled crate; rustdoc JSON format version 60. Only public items are listed.

Owner-thread application plugins and bounded deferred model actions.

Input still routes through the acknowledged presentation in InputRouter. A route borrows this registry for the entire traversal, so handlers cannot register/remove plugins or consume actions while that traversal is running. Only the action queue is transactional: arbitrary plugin-owned state and host/input side effects are not rolled back.

Structs

structaster_ui::plugins::ActionQueueFull

pub struct ActionQueueFull;

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

structaster_ui::plugins::Actions

pub struct Actions<'a, A> { /* see fields */ }

A handler can emit commands but cannot consume or apply queued commands.

Methods

  • fn push(&mut self, value: A) -> Result<(), ActionQueueFull> — An overflow aborts the enclosing route even if the handler ignores this result. All commands from that route are discarded, never a prefix.

structaster_ui::plugins::Limits

pub struct Limits { /* see fields */ }

Methods

  • fn new(plugins: usize, actions: usize) -> Result<Self, RegistryError>

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

structaster_ui::plugins::PluginId

pub struct PluginId { /* see fields */ }

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

structaster_ui::plugins::QueuedAction

pub struct QueuedAction<A> { /* see fields */ }

Public fields

fieldtype
pluginPluginId
presentationPresentationId
frameFrameReceipt
valueA

Trait implementations: Clone, Debug, Eq, PartialEq, StructuralPartialEq

structaster_ui::plugins::RouteResult

pub struct RouteResult<R, E> { /* see fields */ }

Public fields

fieldtype
inputResult<R, Error>
failureOption<Failure<E>>
actions_committedusize

Trait implementations: Debug

structaster_ui::plugins::Runtime

pub struct Runtime<A, E> { /* see fields */ }

Cold-admitted registry, registration-order dispatch and a fixed-count FIFO. Plugin boxes and action values may own application memory beyond this registry's own admitted storage. This type is not Send/Sync.

Methods

  • fn new(limits: Limits) -> Result<Self, RegistryError>
  • fn reserved_bytes(&self) -> usize — Excludes plugin-owned heaps, action-owned heaps and allocator metadata.
  • fn plugin_count(&self) -> usize
  • fn pending_count(&self) -> usize
  • fn register(&mut self, plugin: Box<dyn Plugin<A, E>>) -> Result<PluginId, RegistryError>
  • fn contains(&self, id: PluginId) -> bool
  • fn unregister(&mut self, id: PluginId) -> Result<Box<dyn Plugin<A, E>>, RegistryError> — Invalidates this registration's queued actions and returns its state. A reused slot appends at the end of registration order.
  • fn take_action(&mut self, router: &InputRouter) -> ActionPop<A>
  • fn dispatch_pointer(&mut self, router: &mut InputRouter, presentation: PresentationId, event: PointerEvent) -> RouteResult<PointerDispatch, E>
  • fn dispatch_key(&mut self, router: &mut InputRouter, presentation: PresentationId, event: KeyEvent) -> RouteResult<KeyDispatch, E>

Enums

enumaster_ui::plugins::ActionPop

pub enum ActionPop<A> { Ready, Stale, Empty }

A queued action cannot silently adopt a newer displayed coordinate snapshot.

Variants

  • Ready
  • Stale
  • Empty

Trait implementations: Debug, Eq, PartialEq, StructuralPartialEq

enumaster_ui::plugins::Event

pub enum Event { Pointer, Key }

Variants

  • Pointer
  • Key

Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq

enumaster_ui::plugins::Failure

pub enum Failure<E> { ActionCapacity, Handler }

Variants

  • ActionCapacity
  • Handler

Trait implementations: Debug

enumaster_ui::plugins::RegistryError

pub enum RegistryError { Capacity, Allocation, IdentityExhausted, StalePlugin, GenerationExhausted }

Variants

  • Capacity
  • Allocation
  • IdentityExhausted
  • StalePlugin
  • GenerationExhausted

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

Traits

traitaster_ui::plugins::Plugin

pub trait Plugin<A, E>

Trusted application code, not a sandbox or a resource-limited process. A is an application's typed command; E is its handler error type.

Required and provided methods

  • fn event(&mut self, event: Event, actions: &mut Actions<'_, A>) -> Result<EventReply, E>