[][src]Enum rtdlib::types::PollType

pub enum PollType {
    Quiz(PollTypeQuiz),
    Regular(PollTypeRegular),
    // some variants omitted
}

Describes the type of a poll

Variants

A poll in quiz mode, which has exactly one correct answer option and can be answered only once

A regular poll

Implementations

impl PollType[src]

pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self>[src]

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

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

pub fn on_quiz<F: FnOnce(&PollTypeQuiz)>(&self, fnc: F) -> &Self[src]

pub fn on_regular<F: FnOnce(&PollTypeRegular)>(&self, fnc: F) -> &Self[src]

pub fn as_quiz(&self) -> Option<&PollTypeQuiz>[src]

pub fn as_regular(&self) -> Option<&PollTypeRegular>[src]

pub fn quiz<T: AsRef<PollTypeQuiz>>(t: T) -> Self[src]

pub fn regular<T: AsRef<PollTypeRegular>>(t: T) -> Self[src]

Trait Implementations

impl AsRef<PollType> for PollType[src]

impl Clone for PollType[src]

impl Debug for PollType[src]

impl Default for PollType[src]

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

impl RObject for PollType[src]

impl Serialize for PollType[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.