[][src]Struct twitchchat::UserConfig

pub struct UserConfig {
    pub name: String,
    pub token: String,
    pub capabilities: Vec<Capability>,
}

User configuration for 'registering' with Twitch

This is used to register the connection with the server

It contains your user name, your OAuth token and the capabilities you want to request.

example using a builder

// as anonymous
let config = UserConfig::builder().anonymous().build().unwrap();
// or with a name/token
let name = std::env::var("TWITCH_NAME").unwrap();
let token = std::env::var("TWITCH_TOKEN").unwrap();
let config = UserConfig::builder()
    .name(name)
    .token(token)
    .capabilities(&[Capability::Tags])
    .build()
    .unwrap();

Fields

name: String

Requested name of your user

token: String

OAuth token of the user

capabilities: Vec<Capability>

Capabilities to be requested from the server

Implementations

impl UserConfig[src]

pub fn builder() -> UserConfigBuilder[src]

Create a builder to make a Config

pub fn is_anonymous(&self) -> bool[src]

Determines whether this config was requested as anonymous

Trait Implementations

impl Clone for UserConfig[src]

impl Debug for UserConfig[src]

impl<'de> Deserialize<'de> for UserConfig[src]

impl IntoOwned<'static> for UserConfig[src]

type Output = Self

The output type

impl PartialEq<UserConfig> for UserConfig[src]

impl Serialize for UserConfig[src]

impl StructuralPartialEq for UserConfig[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.