Struct irc::client::Sender

source ·
pub struct Sender { /* private fields */ }
Expand description

Thread-safe sender that can be used with the client.

Implementations§

source§

impl Sender

source

pub fn send<M: Into<Message>>(&self, msg: M) -> Result<()>

Send a single message to the unbounded queue.

source

pub fn send_mode<S, T>(&self, target: S, modes: &[Mode<T>]) -> Result<()>
where S: Display, T: ModeType,

Changes the modes for the specified target.

source

pub fn send_join<S>(&self, chanlist: S) -> Result<()>
where S: Display,

Joins the specified channel or chanlist.

source

pub fn send_join_with_keys<S1, S2>( &self, chanlist: S1, keylist: S2 ) -> Result<()>
where S1: Display, S2: Display,

Joins the specified channel or chanlist using the specified key or keylist.

source

pub fn send_notice<S1, S2>(&self, target: S1, message: S2) -> Result<()>
where S1: Display, S2: Display,

Sends a notice to the specified target.

source

pub fn send_cap_ls(&self, version: NegotiationVersion) -> Result<()>

Sends a request for a list of server capabilities for a specific IRCv3 version.

source

pub fn send_cap_req(&self, extensions: &[Capability]) -> Result<()>

Sends an IRCv3 capabilities request for the specified extensions.

source

pub fn send_sasl<S: Display>(&self, data: S) -> Result<()>

Sends a SASL AUTHENTICATE message with the specified data.

source

pub fn send_sasl_plain(&self) -> Result<()>

Sends a SASL AUTHENTICATE request to use the PLAIN mechanism.

source

pub fn send_sasl_external(&self) -> Result<()>

Sends a SASL AUTHENTICATE request to use the EXTERNAL mechanism.

source

pub fn send_sasl_abort(&self) -> Result<()>

Sends a SASL AUTHENTICATE request to abort authentication.

source

pub fn send_pong<S>(&self, msg: S) -> Result<()>
where S: Display,

Sends a PONG with the specified message.

source

pub fn send_part<S>(&self, chanlist: S) -> Result<()>
where S: Display,

Parts the specified channel or chanlist.

source

pub fn send_oper<S1, S2>(&self, username: S1, password: S2) -> Result<()>
where S1: Display, S2: Display,

Attempts to oper up using the specified username and password.

source

pub fn send_privmsg<S1, S2>(&self, target: S1, message: S2) -> Result<()>
where S1: Display, S2: Display,

Sends a message to the specified target. If the message contains IRC newlines (\r\n), it will automatically be split and sent as multiple separate PRIVMSGs to the specified target. If you absolutely must avoid this behavior, you can do client.send(PRIVMSG(target, message)) directly.

source

pub fn send_topic<S1, S2>(&self, channel: S1, topic: S2) -> Result<()>
where S1: Display, S2: Display,

Sets the topic of a channel or requests the current one. If topic is an empty string, it won’t be included in the message.

source

pub fn send_kill<S1, S2>(&self, target: S1, message: S2) -> Result<()>
where S1: Display, S2: Display,

Kills the target with the provided message.

source

pub fn send_kick<S1, S2, S3>( &self, chanlist: S1, nicklist: S2, message: S3 ) -> Result<()>
where S1: Display, S2: Display, S3: Display,

Kicks the listed nicknames from the listed channels with a comment. If message is an empty string, it won’t be included in the message.

source

pub fn send_samode<S1, S2, S3>( &self, target: S1, mode: S2, modeparams: S3 ) -> Result<()>
where S1: Display, S2: Display, S3: Display,

Changes the mode of the target by force. If modeparams is an empty string, it won’t be included in the message.

source

pub fn send_sanick<S1, S2>(&self, old_nick: S1, new_nick: S2) -> Result<()>
where S1: Display, S2: Display,

Forces a user to change from the old nickname to the new nickname.

source

pub fn send_invite<S1, S2>(&self, nick: S1, chan: S2) -> Result<()>
where S1: Display, S2: Display,

Invites a user to the specified channel.

source

pub fn send_quit<S>(&self, msg: S) -> Result<()>
where S: Display,

Quits the server entirely with a message. This defaults to Powered by Rust. if none is specified.

source

pub fn send_ctcp<S1, S2>(&self, target: S1, msg: S2) -> Result<()>
where S1: Display, S2: Display,

Sends a CTCP-escaped message to the specified target. This requires the CTCP feature to be enabled.

source

pub fn send_action<S1, S2>(&self, target: S1, msg: S2) -> Result<()>
where S1: Display, S2: Display,

Sends an action command to the specified target. This requires the CTCP feature to be enabled.

source

pub fn send_finger<S>(&self, target: S) -> Result<()>
where S: Display,

Sends a finger request to the specified target. This requires the CTCP feature to be enabled.

source

pub fn send_version<S>(&self, target: S) -> Result<()>
where S: Display,

Sends a version request to the specified target. This requires the CTCP feature to be enabled.

source

pub fn send_source<S>(&self, target: S) -> Result<()>
where S: Display,

Sends a source request to the specified target. This requires the CTCP feature to be enabled.

source

pub fn send_user_info<S>(&self, target: S) -> Result<()>
where S: Display,

Sends a user info request to the specified target. This requires the CTCP feature to be enabled.

source

pub fn send_ctcp_ping<S>(&self, target: S) -> Result<()>
where S: Display,

Sends a finger request to the specified target. This requires the CTCP feature to be enabled.

source

pub fn send_time<S>(&self, target: S) -> Result<()>
where S: Display,

Sends a time request to the specified target. This requires the CTCP feature to be enabled.

Trait Implementations§

source§

impl Clone for Sender

source§

fn clone(&self) -> Sender

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Sender

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Sender

§

impl !RefUnwindSafe for Sender

§

impl Send for Sender

§

impl Sync for Sender

§

impl Unpin for Sender

§

impl !UnwindSafe for Sender

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more