pub struct CommandExecutor { /* private fields */ }
Expand description
Central command execution engine that coordinates all wrtype operations.
The executor maintains the complete state needed for virtual keyboard operation:
- Dynamic keymap builder for Unicode and named key support
- Wayland protocol state for communication with compositor
- Connection for protocol message synchronization
Commands are executed sequentially with proper timing and protocol synchronization.
Implementations§
Source§impl CommandExecutor
impl CommandExecutor
Sourcepub fn new(connection: Connection, wayland_state: WaylandState) -> Self
pub fn new(connection: Connection, wayland_state: WaylandState) -> Self
Create a new command executor with initialized Wayland connection and state.
The executor starts with an empty keymap that will grow dynamically as characters and keys are encountered during command execution.
§Arguments
connection
- Active Wayland connection for protocol communicationwayland_state
- Initialized virtual keyboard state with all required objects
Sourcepub fn execute_commands(&mut self, commands: Vec<Command>) -> Result<()>
pub fn execute_commands(&mut self, commands: Vec<Command>) -> Result<()>
Execute a sequence of commands with proper setup and cleanup.
This method performs the complete execution cycle:
- Upload initial empty keymap to establish protocol state
- Execute all commands sequentially in the provided order
- Clean up by releasing all pressed modifiers
Each command execution may update the keymap, requiring re-upload to the compositor. The method ensures proper protocol synchronization throughout the process.
§Arguments
commands
- Sequence of commands to execute in order
§Returns
Ok(())
- All commands executed successfully with cleanup completeErr
- Command execution or protocol communication failure
Auto Trait Implementations§
impl Freeze for CommandExecutor
impl !RefUnwindSafe for CommandExecutor
impl Send for CommandExecutor
impl Sync for CommandExecutor
impl Unpin for CommandExecutor
impl !UnwindSafe for CommandExecutor
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.