pub struct CommandSender { /* private fields */ }Implementations§
Source§impl CommandSender
impl CommandSender
pub fn new(mode: CommandSenderMode) -> Self
pub fn rcon(host: String, port: u16, password: String) -> Self
Sourcepub fn pooled_rcon(host: String, port: u16, password: String) -> Self
pub fn pooled_rcon(host: String, port: u16, password: String) -> Self
Create a pooled RCON sender that maintains a persistent connection. This is more efficient than creating a new connection per command.
pub fn stdin(stdin: ChildStdin) -> Self
Sourcepub async fn send_command(&mut self, command: &str) -> Result<String>
pub async fn send_command(&mut self, command: &str) -> Result<String>
Send a command and return the response text (if available). For RCON, this returns the server’s response to the command. For Stdin, this returns a confirmation string.
Sourcepub async fn send_command_ignore_response(
&mut self,
command: &str,
) -> Result<()>
pub async fn send_command_ignore_response( &mut self, command: &str, ) -> Result<()>
Send a command without caring about the response.
Useful for fire-and-forget commands like say and tellraw.
pub fn name(&self) -> &'static str
Auto Trait Implementations§
impl Freeze for CommandSender
impl !RefUnwindSafe for CommandSender
impl Send for CommandSender
impl Sync for CommandSender
impl Unpin for CommandSender
impl UnsafeUnpin for CommandSender
impl !UnwindSafe for CommandSender
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