[][src]Enum rtdlib::types::OptionValue

pub enum OptionValue {
    GetOption(GetOption),
    Boolean(OptionValueBoolean),
    Empty(OptionValueEmpty),
    Integer(OptionValueInteger),
    String(OptionValueString),
    // some variants omitted
}

Represents the value of an option

Variants

GetOption(GetOption)

Returns the value of an option by its name. (Check the list of available options on https://core.telegram.org/tdlib/options.) Can be called before authorization

Represents a boolean option

Represents an unknown option or an option which has a default value

Represents an integer option

Represents a string option

Implementations

impl OptionValue[src]

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

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

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

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

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

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

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

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

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

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

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

pub fn as_get_option(&self) -> Option<&GetOption>[src]

pub fn as_boolean(&self) -> Option<&OptionValueBoolean>[src]

pub fn as_empty(&self) -> Option<&OptionValueEmpty>[src]

pub fn as_integer(&self) -> Option<&OptionValueInteger>[src]

pub fn as_string(&self) -> Option<&OptionValueString>[src]

pub fn get_option<T: AsRef<GetOption>>(t: T) -> Self[src]

pub fn boolean<T: AsRef<OptionValueBoolean>>(t: T) -> Self[src]

pub fn empty<T: AsRef<OptionValueEmpty>>(t: T) -> Self[src]

pub fn integer<T: AsRef<OptionValueInteger>>(t: T) -> Self[src]

pub fn string<T: AsRef<OptionValueString>>(t: T) -> Self[src]

Trait Implementations

impl AsRef<OptionValue> for OptionValue[src]

impl Clone for OptionValue[src]

impl Debug for OptionValue[src]

impl Default for OptionValue[src]

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

impl RObject for OptionValue[src]

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