pub struct Command { /* private fields */ }
Expand description
A command created by X-Plane or another plugin, that can be triggered
Implementations§
source§impl Command
impl Command
sourcepub fn find(name: &str) -> Result<Self, CommandFindError>
pub fn find(name: &str) -> Result<Self, CommandFindError>
Finds a command
The command should have already been created by X-Plane or another plugin.
sourcepub fn trigger(&mut self)
pub fn trigger(&mut self)
Triggers a command once
This is equivalent to pressing a button down and immediately releasing it.
sourcepub fn hold_down(&mut self) -> CommandHold<'_>
pub fn hold_down(&mut self) -> CommandHold<'_>
Starts holding down this command
The command will be released when the returned hold object is dropped.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl !Send for Command
impl !Sync for Command
impl Unpin for Command
impl UnwindSafe for Command
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