pub enum Command {
Show 15 variants
ADMIN(String),
AWAY(String),
INVITE(String, String),
JOIN(String),
LIST(Option<String>, Option<String>),
MODE(String, Option<String>),
NAMES(String, Option<String>),
NICK(String),
OPER(String, String),
OTHER(String),
PART(String),
PING(String),
PRIVMSG(String, String, String),
QUIT(String),
TOPIC(String, Option<String>),
// some variants omitted
}
Expand description
Commands that can be send or recived from an IRC server.
Variants§
ADMIN(String)
Request information about the admin of a given server.
# let config = Default::default();
# let mut client = Client::new(config).await?;
# client.identify().await?;
client.admin("libera.chat").await?;
# Ok(())
§Errors
Returns IO errors from the TcpStream.
AWAY(String)
Set the status of the client.
# let config = Default::default();
# let mut client = Client::new(config).await?;
# client.identify().await?;
client.away("afk").await?;
# Ok(())
INVITE(String, String)
Invite someone to a channel.
# let config = Default::default();
# let mut client = Client::new(config).await?;
# client.identify().await?;
client.invite("liblemonirc", "#async-circe").await?;
# Ok(())
JOIN(String)
Join a channel.
# let config = Default::default();
# let mut client = Client::new(config).await?;
# client.identify().await?;
client.join("#chaos").await?;
# Ok(())
LIST(Option<String>, Option<String>)
List available channels on an IRC, or users in a channel.
# let config = Default::default();
# let mut client = Client::new(config).await?;
# client.identify().await?;
client.list(None, None).await?;
# Ok(())
MODE(String, Option<String>)
Set the mode for a user.
# let config = Default::default();
# let mut client = Client::new(config).await?;
# client.identify().await?;
client.mode("test", Some("+B")).await?;
# Ok(())
NAMES(String, Option<String>)
Get all the people online in channels.
# let config = Default::default();
# let mut client = Client::new(config).await?;
# client.identify().await?;
client.names("#chaos,#async-circe", None).await?;
# Ok(())
NICK(String)
Change your nickname on a server.
# let config = Default::default();
# let mut client = Client::new(config).await?;
# client.identify().await?;
client.nick("Not async-circe").await?;
# Ok(())
OPER(String, String)
Authentificate as an operator on a server.
# let config = Default::default();
# let mut client = Client::new(config).await?;
# client.identify().await?;
client.oper("username", "password").await?;
# Ok(())
OTHER(String)
Everything that is not a command
PART(String)
Leave a channel.
# let config = Default::default();
# let mut client = Client::new(config).await?;
# client.identify().await?;
client.part("#chaos").await?;
# Ok(())
PING(String)
Tests the presence of a connection to a server.
# let config = Default::default();
# let mut client = Client::new(config).await?;
# client.identify().await?;
client.ping("libera.chat", None).await?;
# Ok(())
PRIVMSG(String, String, String)
Send a message to a channel.
# let config = Default::default();
# let mut client = Client::new(config).await?;
# client.identify().await?;
client.privmsg("#chaos", "Hello").await?;
# Ok(())
QUIT(String)
Leave the IRC server you are connected to.
# let config = Default::default();
# let mut client = Client::new(config).await?;
# client.identify().await?;
client.quit(None).await?;
# Ok(())
TOPIC(String, Option<String>)
Get the topic of a channel.
§Example
# let config = Default::default();
# let mut client = Client::new(config).await?;
# client.identify().await?;
client.topic("#chaos", None).await?;
# Ok(())
Set the topic of a channel.
§Example
# let config = Default::default();
# let mut client = Client::new(config).await?;
# client.identify().await?;
client.topic("#chaos", Some("main channel")).await?;
# Ok(())
§Errors
Returns IO errors from the TcpStream.
Implementations§
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