Skip to main content

Dispatcher

Struct Dispatcher 

Source
pub struct Dispatcher { /* private fields */ }
Expand description

Activation gate and deterministic dispatcher. Opening transports remains a host decision.

Implementations§

Source§

impl Dispatcher

Source

pub const fn new() -> Self

Construct with all external access disabled.

Source

pub fn set_enabled(&mut self, enabled: bool)

Explicitly enable/disable control; transports should also close when disabled.

Source

pub fn enabled(&self) -> bool

Whether external access was explicitly enabled.

Source

pub fn check_enabled(&self) -> Result<(), ActionError>

Reject access before consulting application state.

Source

pub fn execute( &self, host: &mut impl Host, call: Invocation<'_>, ) -> Result<ActionResult, ActionError>

Execute an enabled external action after schema, capability and revision checks.

Source

pub fn execute_local( &self, host: &mut impl Host, name: &str, input: &Value, ) -> Result<ActionResult, ActionError>

Invoke a trusted GUI/shortcut command through the same schema and handler.

Source

pub fn execute_command( &self, host: &mut impl Host, id: u32, input: &Value, ) -> Result<ActionResult, ActionError>

Resolve a legacy numeric GUI command to its registered semantic handler.

Source

pub fn batch( &self, host: &mut impl Host, calls: &[BatchCall], atomic: bool, stop_on_error: bool, ) -> Result<BatchResult, ActionError>

Run an ordered batch. Atomic support and every static precondition are checked first.

Source

pub fn discover( &self, host: &impl Host, query: &str, after: Option<&str>, limit: usize, ) -> Result<Page, ActionError>

Find actions by name/description, with stable lexical ordering and name cursors.

Source

pub fn describe( &self, host: &impl Host, name: &str, ) -> Result<Value, ActionError>

Return schemas, behavior metadata and a concrete availability reason for one action.

Trait Implementations§

Source§

impl Default for Dispatcher

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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.