[][src]Struct twitchchat::encode::AsyncEncoder

pub struct AsyncEncoder<W> { /* fields omitted */ }

An async encoder for messages

Implementations

impl<W: AsyncWrite> AsyncEncoder<W>[src]

pub fn into_inner(self) -> W[src]

This is supported on feature="tokio" only.

Gets the inner writer out

pub fn inner_mut(&mut self) -> &mut W[src]

This is supported on feature="tokio" only.

Get a mutable borrow of the inner writer

pub fn inner(&self) -> &W[src]

This is supported on feature="tokio" only.

Get a borrow of the inner writer

pub fn new(writer: W) -> Self[src]

This is supported on feature="tokio" only.

Make a new encoder from this writer

pub fn with_rate_limiter(self, rate_limit: Arc<Mutex<RateLimit>>) -> Self[src]

This is supported on feature="tokio" only.

Compose this encoder with a shared rate limiter

impl<W: AsyncWrite + Send + Unpin> AsyncEncoder<W>[src]

pub async fn ban<'a, '_, '_>(
    &'_ mut self,
    channel: impl IntoChannel,
    username: &'_ str,
    reason: impl Into<Option<&'a str>> + Send
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Permanently prevent a user from chatting. Reason is optional and will be shown to the target user and other moderators.

Use unban to remove a ban.

pub async fn clear<'_>(
    &'_ mut self,
    channel: impl IntoChannel
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Clear chat history for all users in this room.

pub async fn color<'_>(&'_ mut self, color: Color) -> Result<(), Error>[src]

This is supported on feature="tokio" only.

Change your username color.

pub async fn command<'_, '_>(
    &'_ mut self,
    channel: impl IntoChannel,
    data: &'_ str
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Sends the command: data (e.g. /color #FFFFFF)

pub async fn jtv_command<'_, '_>(
    &'_ mut self,
    data: &'_ str
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Sends the command: data to the 'jtv' channel (e.g. /color #FFFFFF)

pub async fn commercial<'_>(
    &'_ mut self,
    channel: impl IntoChannel,
    length: impl Into<Option<usize>> + Send
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Triggers a commercial.

Length (optional) must be a positive number of seconds.

pub async fn disconnect<'_>(&'_ mut self) -> Result<(), Error>[src]

This is supported on feature="tokio" only.

Reconnects to chat.

pub async fn emote_only<'_>(
    &'_ mut self,
    channel: impl IntoChannel
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Enables emote-only mode (only emoticons may be used in chat).

Use emote_only_off to disable.

pub async fn emote_only_off<'_>(
    &'_ mut self,
    channel: impl IntoChannel
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Disables emote-only mode.

pub async fn followers<'_, '_>(
    &'_ mut self,
    channel: impl IntoChannel,
    duration: &'_ str
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Enables followers-only mode (only users who have followed for duration may chat).

Examples: "30m", "1 week", "5 days 12 hours".

Must be less than 3 months.

pub async fn followers_off<'_>(
    &'_ mut self,
    channel: impl IntoChannel
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Disables followers-only mode.

pub async fn give_mod<'_, '_>(
    &'_ mut self,
    channel: impl IntoChannel,
    username: &'_ str
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Grant moderator status to a user.

Use mods to list the moderators of this channel.

pub async fn help<'_>(
    &'_ mut self,
    channel: impl IntoChannel
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Lists the commands available to you in this room.

pub async fn host<'_>(
    &'_ mut self,
    source: impl IntoChannel,
    target: impl IntoChannel
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Host another channel.

Use unhost to unset host mode.

pub async fn join<'_>(
    &'_ mut self,
    channel: impl IntoChannel
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Join a channel

pub async fn marker<'a, '_>(
    &'_ mut self,
    channel: impl IntoChannel,
    comment: impl Into<Option<&'a str>> + Send
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Adds a stream marker (with an optional comment, max 140 characters) at the current timestamp.

You can use markers in the Highlighter for easier editing.

If the string exceeds 140 characters then it will be truncated

pub async fn me<'_, '_>(
    &'_ mut self,
    channel: impl IntoChannel,
    message: &'_ str
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Sends an "emote" message in the third person to the channel

pub async fn mods<'_>(
    &'_ mut self,
    channel: impl IntoChannel
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Lists the moderators of this channel.

pub async fn part<'_>(
    &'_ mut self,
    channel: impl IntoChannel
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Leave a channel

pub async fn ping<'_, '_>(&'_ mut self, token: &'_ str) -> Result<(), Error>[src]

This is supported on feature="tokio" only.

Request a heartbeat with the provided token

pub async fn pong<'_, '_>(&'_ mut self, token: &'_ str) -> Result<(), Error>[src]

This is supported on feature="tokio" only.

Response to a heartbeat with the provided token

pub async fn privmsg<'_, '_>(
    &'_ mut self,
    channel: impl IntoChannel,
    data: &'_ str
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Send data to a channel

pub async fn r9k_beta<'_>(
    &'_ mut self,
    channel: impl IntoChannel
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Enables r9k mode.

Use r9k_beta_off to disable.

pub async fn r9k_beta_off<'_>(
    &'_ mut self,
    channel: impl IntoChannel
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Disables r9k mode.

pub async fn raid<'_>(
    &'_ mut self,
    source: impl IntoChannel,
    target: impl IntoChannel
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Raid another channel.

Use unraid to cancel the Raid.

pub async fn raw<'_, '_>(&'_ mut self, raw: &'_ str) -> Result<(), Error>[src]

This is supported on feature="tokio" only.

Send a raw IRC-style message

pub async fn slow<'_>(
    &'_ mut self,
    channel: impl IntoChannel,
    duration: impl Into<Option<usize>> + Send
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Enables slow mode (limit how often users may send messages).

Duration (optional, default=120) must be a positive number of seconds.

Use slow_off to disable.

pub async fn slow_off<'_>(
    &'_ mut self,
    channel: impl IntoChannel
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Disables slow mode.

pub async fn subscribers<'_>(
    &'_ mut self,
    channel: impl IntoChannel
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Enables subscribers-only mode (only subscribers may chat in this channel).

Use subscribers_off to disable.

pub async fn subscribers_off<'_>(
    &'_ mut self,
    channel: impl IntoChannel
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Disables subscribers-only mode.

pub async fn timeout<'a, 'b, '_, '_>(
    &'_ mut self,
    channel: impl IntoChannel,
    username: &'_ str,
    duration: impl Into<Option<&'a str>> + Send,
    message: impl Into<Option<&'b str>> + Send
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Temporarily prevent a user from chatting.

  • duration (optional, default=10 minutes) must be a positive integer.
  • time unit (optional, default=s) must be one of
    • s
    • m
    • h
    • d
    • w
  • maximum duration is 2 weeks.

Combinations like 1d2h are also allowed.

Reason is optional and will be shown to the target user and other moderators.

Use untimeout to remove a timeout.

pub async fn unban<'_, '_>(
    &'_ mut self,
    channel: impl IntoChannel,
    username: &'_ str
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Removes a ban on a user.

pub async fn unhost<'_>(
    &'_ mut self,
    channel: impl IntoChannel
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Stop hosting another channel.

pub async fn unmod<'_, '_>(
    &'_ mut self,
    channel: impl IntoChannel,
    username: &'_ str
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Revoke moderator status from a user.

Use mods to list the moderators of this channel.

pub async fn unraid<'_>(
    &'_ mut self,
    channel: impl IntoChannel
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Cancel the Raid.

pub async fn untimeout<'_, '_>(
    &'_ mut self,
    channel: impl IntoChannel,
    username: &'_ str
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Removes a timeout on a user.

pub async fn unvip<'_, '_>(
    &'_ mut self,
    channel: impl IntoChannel,
    username: &'_ str
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Revoke VIP status from a user.

Use vips to list the VIPs of this channel.

pub async fn vip<'_, '_>(
    &'_ mut self,
    channel: impl IntoChannel,
    username: &'_ str
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Grant VIP status to a user.

Use vips to list the VIPs of this channel.

pub async fn vips<'_>(
    &'_ mut self,
    channel: impl IntoChannel
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Lists the VIPs of this channel.

pub async fn whisper<'_, '_, '_>(
    &'_ mut self,
    username: &'_ str,
    message: &'_ str
) -> Result<(), Error>
[src]

This is supported on feature="tokio" only.

Whispers the message to the username.

Trait Implementations

impl<W: AsyncWrite + Clone> Clone for AsyncEncoder<W>[src]

impl<W> Debug for AsyncEncoder<W>[src]

impl<W: AsyncWrite + Default> Default for AsyncEncoder<W>[src]

Auto Trait Implementations

impl<W> !RefUnwindSafe for AsyncEncoder<W>

impl<W> Send for AsyncEncoder<W> where
    W: Send

impl<W> Sync for AsyncEncoder<W> where
    W: Sync

impl<W> Unpin for AsyncEncoder<W> where
    W: Unpin

impl<W> !UnwindSafe for AsyncEncoder<W>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.