[][src]Struct teloxide::types::Update

#[non_exhaustive]pub struct Update {
    pub id: i32,
    pub kind: UpdateKind,
}

This object represents an incoming update.

The official docs.

Fields (Non-exhaustive)

Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
id: i32

The update‘s unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you’re using Webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially.

kind: UpdateKind

Implementations

impl Update[src]

pub fn new(id: i32, kind: UpdateKind) -> Self[src]

pub fn id<S>(self, val: i32) -> Self[src]

pub fn kind<S>(self, val: UpdateKind) -> Self[src]

impl Update[src]

pub fn try_parse(value: &Value) -> Result<Self, Error>[src]

Tries to parse value into Update, logging an error if failed.

It is used to implement update listeners.

impl Update[src]

pub fn user(&self) -> Option<&User>[src]

pub fn chat(&self) -> Option<&Chat>[src]

Trait Implementations

impl Clone for Update[src]

impl Debug for Update[src]

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

impl PartialEq<Update> for Update[src]

impl Serialize for Update[src]

impl StructuralPartialEq for Update[src]

Auto Trait Implementations

impl RefUnwindSafe for Update

impl Send for Update

impl Sync for Update

impl Unpin for Update

impl UnwindSafe for Update

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> 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.