pub struct Dispatcher { /* private fields */ }Expand description
Activation gate and deterministic dispatcher. Opening transports remains a host decision.
Implementations§
Source§impl Dispatcher
impl Dispatcher
Sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Explicitly enable/disable control; transports should also close when disabled.
Sourcepub fn check_enabled(&self) -> Result<(), ActionError>
pub fn check_enabled(&self) -> Result<(), ActionError>
Reject access before consulting application state.
Sourcepub fn execute(
&self,
host: &mut impl Host,
call: Invocation<'_>,
) -> Result<ActionResult, ActionError>
pub fn execute( &self, host: &mut impl Host, call: Invocation<'_>, ) -> Result<ActionResult, ActionError>
Execute an enabled external action after schema, capability and revision checks.
Sourcepub fn execute_local(
&self,
host: &mut impl Host,
name: &str,
input: &Value,
) -> Result<ActionResult, ActionError>
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.
Sourcepub fn execute_command(
&self,
host: &mut impl Host,
id: u32,
input: &Value,
) -> Result<ActionResult, ActionError>
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.
Sourcepub fn batch(
&self,
host: &mut impl Host,
calls: &[BatchCall],
atomic: bool,
stop_on_error: bool,
) -> Result<BatchResult, ActionError>
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.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Dispatcher
impl Freeze for Dispatcher
impl RefUnwindSafe for Dispatcher
impl Send for Dispatcher
impl Sync for Dispatcher
impl Unpin for Dispatcher
impl UnsafeUnpin for Dispatcher
impl UnwindSafe for Dispatcher
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
Mutably borrows from an owned value. Read more