pub struct Command { /* private fields */ }
Expand description
A Command can be passed to MinecraftConnection::execute_commands and contains a Minecraft command to execute and optionally a custom name.
The custom name can be useful in conjunction with MinecraftConnection::add_named_listener to easily and performantly filter for the correct LogEvent.
Implementations§
Source§impl Command
impl Command
Sourcepub fn new(command: impl Into<String>) -> Command
pub fn new(command: impl Into<String>) -> Command
Creates a Command without custom name. These commands are typically executed under the
name @
.
Sourcepub fn named(name: impl Into<String>, command: impl Into<String>) -> Command
pub fn named(name: impl Into<String>, command: impl Into<String>) -> Command
Creates a Command with the given custom name
.
Sourcepub fn get_command(&self) -> &str
pub fn get_command(&self) -> &str
The Minecraft command.
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