[−][src]Struct twitchchat::Encoder
An encoder for messages
Methods
impl<W: Write> Encoder<W>
[src]
pub fn into_inner(self) -> W
[src]
Gets the inner writer out
pub fn inner_mut(&mut self) -> &mut W
[src]
Get a mutable borrow of the inner writer
pub fn inner(&self) -> &W
[src]
Get a borrow of the inner writer
pub fn new(writer: W) -> Self
[src]
Make a new encoder from this writer
impl<W: Write> Encoder<W>
[src]
pub fn ban<'a>(
&mut self,
username: &str,
reason: impl Into<Option<&'a str>>
) -> Result<(), Error>
[src]
&mut self,
username: &str,
reason: impl Into<Option<&'a str>>
) -> Result<(), Error>
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 fn clear(&mut self) -> Result<(), Error>
[src]
Clear chat history for all users in this room.
pub fn color(&mut self, color: Color) -> Result<(), Error>
[src]
Change your username color.
pub fn command(&mut self, data: &str) -> Result<(), Error>
[src]
Sends the command: data (e.g. /color #FFFFFF)
pub fn commercial(
&mut self,
length: impl Into<Option<usize>>
) -> Result<(), Error>
[src]
&mut self,
length: impl Into<Option<usize>>
) -> Result<(), Error>
Triggers a commercial.
Length (optional) must be a positive number of seconds.
pub fn disconnect(&mut self) -> Result<(), Error>
[src]
Reconnects to chat.
pub fn emote_only(&mut self) -> Result<(), Error>
[src]
Enables emote-only mode (only emoticons may be used in chat).
Use emote_only_off to disable.
pub fn emote_only_off(&mut self) -> Result<(), Error>
[src]
Disables emote-only mode.
pub fn followers(&mut self, duration: &str) -> Result<(), Error>
[src]
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 fn followers_off(&mut self) -> Result<(), Error>
[src]
Disables followers-only mode.
pub fn give_mod(&mut self, username: &str) -> Result<(), Error>
[src]
Grant moderator status to a user.
Use mods to list the moderators of this channel.
pub fn help(&mut self) -> Result<(), Error>
[src]
Lists the commands available to you in this room.
pub fn host(&mut self, channel: impl IntoChannel) -> Result<(), Error>
[src]
Host another channel.
Use unhost to unset host mode.
pub fn join(&mut self, channel: impl IntoChannel) -> Result<(), Error>
[src]
Join a channel
pub fn marker<'a>(
&mut self,
comment: impl Into<Option<&'a str>>
) -> Result<(), Error>
[src]
&mut self,
comment: impl Into<Option<&'a str>>
) -> Result<(), Error>
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 fn me(
&mut self,
channel: impl IntoChannel,
message: &str
) -> Result<(), Error>
[src]
&mut self,
channel: impl IntoChannel,
message: &str
) -> Result<(), Error>
Sends an "emote" message in the third person to the channel
pub fn mods(&mut self) -> Result<(), Error>
[src]
Lists the moderators of this channel.
pub fn part(&mut self, channel: impl IntoChannel) -> Result<(), Error>
[src]
Leave a channel
pub fn ping(&mut self, token: &str) -> Result<(), Error>
[src]
Request a heartbeat with the provided token
pub fn pong(&mut self, token: &str) -> Result<(), Error>
[src]
Response to a heartbeat with the provided token
pub fn privmsg(&mut self, target: &str, data: &str) -> Result<(), Error>
[src]
Send data to a target
pub fn r9k_beta(&mut self) -> Result<(), Error>
[src]
Enables r9k mode.
Use r9k_beta_off to disable.
pub fn r9k_beta_off(&mut self) -> Result<(), Error>
[src]
Disables r9k mode.
pub fn raid(&mut self, channel: impl IntoChannel) -> Result<(), Error>
[src]
Raid another channel.
Use unraid to cancel the Raid.
pub fn raw(&mut self, raw: impl AsRef<[u8]>) -> Result<(), Error>
[src]
Send a raw IRC-style message
pub fn slow(&mut self, duration: impl Into<Option<usize>>) -> Result<(), Error>
[src]
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 fn slow_off(&mut self) -> Result<(), Error>
[src]
Disables slow mode.
pub fn subscribers(&mut self) -> Result<(), Error>
[src]
Enables subscribers-only mode (only subscribers may chat in this channel).
Use subscribers_off to disable.
pub fn subscribers_off(&mut self) -> Result<(), Error>
[src]
Disables subscribers-only mode.
pub fn timeout<'a, 'b>(
&mut self,
username: &str,
duration: impl Into<Option<&'a str>>,
message: impl Into<Option<&'b str>>
) -> Result<(), Error>
[src]
&mut self,
username: &str,
duration: impl Into<Option<&'a str>>,
message: impl Into<Option<&'b str>>
) -> Result<(), Error>
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 fn unban(&mut self, username: &str) -> Result<(), Error>
[src]
Removes a ban on a user.
pub fn unhost(&mut self) -> Result<(), Error>
[src]
Stop hosting another channel.
pub fn unmod(&mut self, username: &str) -> Result<(), Error>
[src]
Revoke moderator status from a user.
Use mods to list the moderators of this channel.
pub fn unraid(&mut self) -> Result<(), Error>
[src]
Cancel the Raid.
pub fn untimeout(&mut self, username: &str) -> Result<(), Error>
[src]
Removes a timeout on a user.
pub fn unvip(&mut self, username: &str) -> Result<(), Error>
[src]
Revoke VIP status from a user.
Use vips to list the VIPs of this channel.
pub fn vip(&mut self, username: &str) -> Result<(), Error>
[src]
Grant VIP status to a user.
Use vips to list the VIPs of this channel.
pub fn vips(&mut self) -> Result<(), Error>
[src]
Lists the VIPs of this channel.
pub fn whisper(&mut self, username: &str, message: &str) -> Result<(), Error>
[src]
Whispers the message to the username.
Trait Implementations
impl<W: Write + Clone> Clone for Encoder<W>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<W> Debug for Encoder<W>
[src]
impl<W: Write + Default> Default for Encoder<W>
[src]
Auto Trait Implementations
impl<W> RefUnwindSafe for Encoder<W> where
W: RefUnwindSafe,
W: RefUnwindSafe,
impl<W> Send for Encoder<W> where
W: Send,
W: Send,
impl<W> Sync for Encoder<W> where
W: Sync,
W: Sync,
impl<W> Unpin for Encoder<W> where
W: Unpin,
W: Unpin,
impl<W> UnwindSafe for Encoder<W> where
W: UnwindSafe,
W: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,