pub struct DispatchedCommand {
pub command_id: CommandId,
pub event: HubEvent,
}Expand description
A command that has been prepared for execution with a unique identifier.
DispatchedCommand represents a command that has been assigned a unique
CommandId and wrapped in an Event ready for processing. This structure
allows callers to track command completion by matching the command ID
with results returned from EventResults::completed_commands.
§Usage Pattern
- Create a command using
Eventstatic methods (e.g.,Event::create_connection(ConnDirection::Outgoing)) - Store the
command_idto track completion - Pass the
eventtoSamod::handle_event - Check for completion using the
command_idin subsequentEventResults
Fields§
§command_id: CommandIdThe unique identifier for this command.
This ID can be used to match command results when they become available
in EventResults::completed_commands.
event: HubEventThe event containing the command to be processed.
This event should be passed to Samod::handle_event to execute the command.
Auto Trait Implementations§
impl Freeze for DispatchedCommand
impl RefUnwindSafe for DispatchedCommand
impl Send for DispatchedCommand
impl Sync for DispatchedCommand
impl Unpin for DispatchedCommand
impl UnwindSafe for DispatchedCommand
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more