[][src]Enum tbot::types::parameters::poll::AutoClose

#[non_exhaustive]pub enum AutoClose {
    OpenPeriod(u16),
    CloseDate(i64),
}

Tells when the poll is automatically closed.

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
OpenPeriod(u16)

Reflects the open_period field.

CloseDate(i64)

Reflects the close_date field.

Implementations

impl AutoClose[src]

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

Returns true if self is of variant OpenPeriod.

pub fn expect_open_period(self) -> u16 where
    Self: Debug
[src]

Unwraps the value, yielding the content of OpenPeriod.

Panics

Panics if the value is not OpenPeriod, with a panic message including the content of self.

pub fn open_period(self) -> Option<u16>[src]

Returns Some if self is of variant OpenPeriod, and None otherwise.

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

Returns true if self is of variant CloseDate.

pub fn expect_close_date(self) -> i64 where
    Self: Debug
[src]

Unwraps the value, yielding the content of CloseDate.

Panics

Panics if the value is not CloseDate, with a panic message including the content of self.

pub fn close_date(self) -> Option<i64>[src]

Returns Some if self is of variant CloseDate, and None otherwise.

Trait Implementations

impl Clone for AutoClose[src]

impl Copy for AutoClose[src]

impl Debug for AutoClose[src]

impl Eq for AutoClose[src]

impl Hash for AutoClose[src]

impl PartialEq<AutoClose> for AutoClose[src]

impl Serialize for AutoClose[src]

impl StructuralEq for AutoClose[src]

impl StructuralPartialEq for AutoClose[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<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

impl<T> Instrument for T[src]

impl<T> Instrument 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.

impl<T> WithSubscriber for T[src]