[][src]Struct twitchchat::Writer

pub struct Writer<W>(pub Arc<Mutex<W>>);

A thread-safe, clonable writer for the Twitch client

Methods

impl<W: Write> Writer<W>[src]

pub fn host(&self, channel: &str) -> Result<(), Error>[src]

pub fn unhost(&self) -> Result<(), Error>[src]

pub fn marker(&self, comment: Option<&str>) -> Result<(), Error>[src]

pub fn raid(&self, channel: &str) -> Result<(), Error>[src]

pub fn unraid(&self) -> Result<(), Error>[src]

pub fn color<C: Into<TwitchColor>>(&self, color: C) -> Result<(), Error>[src]

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

pub fn help(&self) -> Result<(), Error>[src]

pub fn mods(&self) -> Result<(), Error>[src]

pub fn vips(&self) -> Result<(), Error>[src]

pub fn commercial(&self, length: Option<usize>) -> Result<(), Error>[src]

pub fn ban(&self, username: &str, reason: Option<&str>) -> Result<(), Error>[src]

pub fn unban(&self, username: &str) -> Result<(), Error>[src]

pub fn clear(&self) -> Result<(), Error>[src]

pub fn emoteonly(&self) -> Result<(), Error>[src]

pub fn emoteonlyoff(&self) -> Result<(), Error>[src]

pub fn followers(&self, duration: &str) -> Result<(), Error>[src]

pub fn followersoff(&self) -> Result<(), Error>[src]

pub fn op(&self, username: &str) -> Result<(), Error>[src]

pub fn unmod(&self, username: &str) -> Result<(), Error>[src]

pub fn r9kbeta(&self) -> Result<(), Error>[src]

pub fn r9kbetaoff(&self) -> Result<(), Error>[src]

pub fn slow(&self, duration: Option<usize>) -> Result<(), Error>[src]

pub fn slowoff(&self) -> Result<(), Error>[src]

pub fn subscribers(&self) -> Result<(), Error>[src]

pub fn subscribersoff(&self) -> Result<(), Error>[src]

pub fn timeout(
    &self,
    username: &str,
    duration: Option<&str>,
    reason: Option<&str>
) -> Result<(), Error>
[src]

pub fn untimeout(&self, username: &str) -> Result<(), Error>[src]

pub fn vip(&self, username: &str) -> Result<(), Error>[src]

pub fn unvip(&self, username: &str) -> Result<(), Error>[src]

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

pub fn join<C: Into<Channel>>(&self, channel: C) -> Result<(), Error>[src]

Joins a channel

This ensures the channel name is lowercased and begins with a '#'.

The following are equivilant

let w = client.writer();
w.join("museun").unwrap();
w.join("#museun").unwrap();
w.join("Museun").unwrap();
w.join("#MUSEUN").unwrap();

pub fn part<C: Into<Channel>>(&self, channel: C) -> Result<(), Error>[src]

Parts a channel

This ensures the channel name is lowercased and begins with a '#'.

The following are equivilant

let w = client.writer();
w.part("museun").unwrap();
w.part("#museun").unwrap();
w.part("Museun").unwrap();
w.part("#MUSEUN").unwrap();

pub fn me<C, S>(&self, channel: C, message: S) -> Result<(), Error> where
    C: Into<Channel>,
    S: AsRef<str>, 
[src]

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

This ensures the channel name is lowercased and begins with a '#'.

pub fn privmsg<C, S>(&self, channel: C, message: S) -> Result<(), Error> where
    C: Into<Channel>,
    S: AsRef<str>, 
[src]

Sends the message to the channel

This ensures the channel name is lowercased and begins with a '#'.

Same as send

pub fn send<C, S>(&self, channel: C, message: S) -> Result<(), Error> where
    C: Into<Channel>,
    S: AsRef<str>, 
[src]

Sends the message to the channel

This ensures the channel name is lowercased and begins with a '#'.

Same as privmsg

pub fn command<S>(&self, data: S) -> Result<(), Error> where
    S: AsRef<str>, 
[src]

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

pub fn raw<S>(&self, data: S) -> Result<(), Error> where
    S: AsRef<str>, 
[src]

Sends a raw line (appends the required \r\n)

Trait Implementations

impl<W: Write> WriterExt for Writer<W>[src]

impl<W: Write> Clone for Writer<W>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

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

impl<W> Sync for Writer<W> where
    W: Send

Blanket Implementations

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

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

type Owned = T

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.