[][src]Trait twitchchat::ClientExt

pub trait ClientExt {
    fn inspect<F>(&mut self, f: F)
    where
        F: Fn(String) + Send + Sync + 'static
;
fn remove_inspect(&mut self);
fn join_many<'a, I, S>(&mut self, channels: I) -> Result<(), Error>
    where
        I: IntoIterator<Item = S> + 'a,
        S: AsRef<str> + 'a
; }

Client extensions

Required methods

fn inspect<F>(&mut self, f: F) where
    F: Fn(String) + Send + Sync + 'static, 

When this is set, all "raw" reads from the Read portion of the client will be copied to the provided function

client.inspect(|msg: String| {
    println!("<-- {}", msg)
});

fn remove_inspect(&mut self)

Remove the inspection function, if it exists

fn join_many<'a, I, S>(&mut self, channels: I) -> Result<(), Error> where
    I: IntoIterator<Item = S> + 'a,
    S: AsRef<str> + 'a, 

Join a (huge) list of channels

This will efficiently partition all of the JOIN commands into max-sized messages

Ensuring the channel names are properly formatted and doing the least amount of actual writes as possible

client
    .join_many(
        std::fs::read_to_string("active.txt")
            .unwrap()
            .split('\n')
            .map(str::trim),
    )
    .unwrap();
Loading content...

Implementors

impl<R, W: Write> ClientExt for Client<R, W>[src]

Loading content...