Struct twitch_api::TmiClient

source ·
pub struct TmiClient<'a, C: HttpClient + 'a> { /* private fields */ }
👎Deprecated: All TMI functionality has been implemented with helix endpoint Get Chatters
Available on crate features client and tmi only.
Expand description

Client for the twitch TMI endpoint, almost entirely undocumented and certainly not supported.

Examples

let client = TmiClient::new();
println!("{:?}", client.get_chatters("justinfan10".into()).await?);

Most clients will be able to use the 'static lifetime

pub struct MyStruct {
    twitch: TmiClient<'static, reqwest::Client>,
    token: twitch_oauth2::AppAccessToken,
}
// etc

See HttpClient for implemented http clients, you can also define your own if needed.

Implementations§

source§

impl<'a, C: HttpClient + 'a> TmiClient<'a, C>

source

pub fn with_client(client: C) -> TmiClient<'a, C>

Create a new client with an existing client

source

pub fn new() -> TmiClient<'a, C>where C: ClientDefault<'a>,

Create a new TmiClient with a default HttpClient

source

pub fn clone_client(&self) -> Cwhere C: Clone,

Retrieve a clone of the HttpClient inside this TmiClient

source

pub fn get_client(&self) -> &C

Retrieve a reference of the HttpClient inside this TmiClient

source

pub async fn get_chatters( &'a self, broadcaster: &UserNameRef ) -> Result<GetChatters, RequestError<<C as HttpClient>::Error>>

👎Deprecated: Has been implemented with helix endpoint Get Chatters

Get all the chatters in the chat

Notes

This function will aside from url sanitize the broadcasters username, will also remove any # and make it lowercase ascii

Trait Implementations§

source§

impl<'c, C: Client + Sync + 'c> Client for TmiClient<'c, C>

§

type Error = CompatError<<C as Client>::Error>

Error returned by the client
source§

fn req( &self, request: Request<Vec<u8>> ) -> BoxedFuture<'_, Result<Response<Vec<u8>>, <Self as Client>::Error>>

Send a request
source§

impl<'a, C: Clone + HttpClient + 'a> Clone for TmiClient<'a, C>

source§

fn clone(&self) -> TmiClient<'a, C>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<C: HttpClient + ClientDefault<'static>> Default for TmiClient<'static, C>

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a, C> RefUnwindSafe for TmiClient<'a, C>where C: RefUnwindSafe,

§

impl<'a, C> Send for TmiClient<'a, C>

§

impl<'a, C> Sync for TmiClient<'a, C>

§

impl<'a, C> Unpin for TmiClient<'a, C>where C: Unpin,

§

impl<'a, C> UnwindSafe for TmiClient<'a, C>where C: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more