[][src]Trait twitchchat::WriterExt

pub trait WriterExt {
    fn join_many<'a, I>(&self, channels: I) -> Result<JoinStats, Error>
    where
        I: IntoIterator + 'a,
        I::Item: AsRef<str> + 'a
;
fn join_many_limited<'a, I>(
        &self,
        channels: I,
        rate: Option<RateLimit>
    ) -> Result<JoinStats, Error>
    where
        I: IntoIterator + 'a,
        I::Item: AsRef<str> + 'a
; }

Writer extensions

Required methods

fn join_many<'a, I>(&self, channels: I) -> Result<JoinStats, Error> where
    I: IntoIterator + 'a,
    I::Item: 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

Returns a JoinStats which details how many messages were sent and the total number of channels

use twitchchat::WriterExt as _;
let writer = client.writer();
writer
    .join_many(
        std::fs::read_to_string("active.txt")
            .unwrap()
            .split('\n')
            .map(str::trim),
    )
    .unwrap();

fn join_many_limited<'a, I>(
    &self,
    channels: I,
    rate: Option<RateLimit>
) -> Result<JoinStats, Error> where
    I: IntoIterator + 'a,
    I::Item: AsRef<str> + 'a, 

Join a (huge) list of channels but using a RateLimit

Same as WriterExt::join_many, but takes in an optional RateLimit

If no rate limiter is provided then a default is used (50 channels per 15 seconds)

Returns a JoinStats which details how many messages were sent and the total number of channels

Loading content...

Implementors

impl WriterExt for Writer[src]

Loading content...