pub struct CommandExecutor<M = ()> { /* private fields */ }Expand description
Executes commands and sends resulting messages
Implementations§
Source§impl<M> CommandExecutor<M>
impl<M> CommandExecutor<M>
Sourcepub fn with_error_handler<H>(error_handler: H) -> Result<Self>
pub fn with_error_handler<H>(error_handler: H) -> Result<Self>
Create a new command executor with custom error handler
Sourcepub fn with_resource_limits(limits: ResourceLimits) -> Result<Self>
pub fn with_resource_limits(limits: ResourceLimits) -> Result<Self>
Create a new command executor with custom resource limits
Sourcepub fn resource_stats(&self) -> ResourceStats
pub fn resource_stats(&self) -> ResourceStats
Get current resource statistics
Sourcepub fn execute(&self, cmd: Cmd<M>, tx: &SyncSender<Event<M>>)
pub fn execute(&self, cmd: Cmd<M>, tx: &SyncSender<Event<M>>)
Execute a command and send the result through the channel
Sourcepub fn execute_batch(&self, commands: Vec<Cmd<M>>, tx: &SyncSender<Event<M>>)
pub fn execute_batch(&self, commands: Vec<Cmd<M>>, tx: &SyncSender<Event<M>>)
Execute a batch of commands concurrently
Sourcepub fn execute_sequence(&self, commands: Vec<Cmd<M>>, tx: &SyncSender<Event<M>>)
pub fn execute_sequence(&self, commands: Vec<Cmd<M>>, tx: &SyncSender<Event<M>>)
Execute a sequence of commands (one after another)
Sourcepub fn spawn<F>(&self, future: F) -> JoinHandle<F::Output>
pub fn spawn<F>(&self, future: F) -> JoinHandle<F::Output>
Spawn a future on the runtime with resource limit checking
Trait Implementations§
Source§impl<M: Clone> Clone for CommandExecutor<M>
impl<M: Clone> Clone for CommandExecutor<M>
Source§fn clone(&self) -> CommandExecutor<M>
fn clone(&self) -> CommandExecutor<M>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<M> Freeze for CommandExecutor<M>
impl<M = ()> !RefUnwindSafe for CommandExecutor<M>
impl<M> Send for CommandExecutor<M>
impl<M> Sync for CommandExecutor<M>
impl<M> Unpin for CommandExecutor<M>
impl<M = ()> !UnwindSafe for CommandExecutor<M>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Inspectable for T
impl<T> Inspectable for T
Source§fn inspect_if(self, condition: bool, label: &str) -> Selfwhere
Self: Debug,
fn inspect_if(self, condition: bool, label: &str) -> Selfwhere
Self: Debug,
Conditionally inspect this value
Source§fn inspect_with<F>(self, label: &str, f: F) -> Self
fn inspect_with<F>(self, label: &str, f: F) -> Self
Inspect with a custom formatter