pub struct Client<A> { /* private fields */ }
Expand description

Entrypoint for making requests to the Trovo api.

Implementations

Get a chat token for the provided channel id

Connect to the given channel id and receive a stream of messages.

Get a chat token for the authenticated user’s channel

Connect to the authenticated user’s channel and receive a stream of messages.

Send a chat message to a channel

Scopes
Sending to your own channel

Requires chat_send_self

Sending to other channels

To send a message as sender (user A) to channel (owned by user B), the application needs to get scopes chat_send_self of user A, and send_to_my_channel of user B.

Creates a new default trovo client. If you are already using reqwest in your program, it is advisable to use Client::from_reqwest instead to allow for connection pool sharing.

Panics

This method panics if a TLS backend cannot be initialized, or the resolver cannot load the system configuration.

Creates a new trovo client using the provided reqwest client.

This can be useful to allow sharing of a reqwest client’s connection pool across your program

Gets a list of user’s channel id, user id, and nickname, by usernames.

Note: Even if just one of the usernames doesn’t exist, the result will be an empty vec due to api limitations.

Gets a user’s channel id, user id, and nickname, by username.

Returns None if the user was not found

Gets channel information for the given id

Returns None if the channel was not found

Gets list of emotes for each channel and global/event emotes if requested.

Allows you to update the user’s channel settings, including title, category, language, audience type. You may update only part of the info.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

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

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

Calls U::from(self).

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

Should always be Self

The resulting type after obtaining ownership.

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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