pub struct UpdatesStateSnap {
pub pts: i32,
pub qts: i32,
pub date: i32,
pub seq: i32,
pub channels: Vec<(i64, i32)>,
}Expand description
Snapshot of the MTProto update-sequence state that we persist so that
catch_up: true can call updates.getDifference with the pre-shutdown pts.
Fields§
§pts: i32Main persistence counter (messages, non-channel updates).
qts: i32Secondary counter for secret chats.
date: i32Date of the last received update (Unix timestamp).
seq: i32Combined-container sequence number.
channels: Vec<(i64, i32)>Per-channel persistence counters. (channel_id, pts).
Implementations§
Source§impl UpdatesStateSnap
impl UpdatesStateSnap
Sourcepub fn is_initialised(&self) -> bool
pub fn is_initialised(&self) -> bool
Returns true when we have a real state from the server (pts > 0).
Sourcepub fn set_channel_pts(&mut self, channel_id: i64, pts: i32)
pub fn set_channel_pts(&mut self, channel_id: i64, pts: i32)
Advance (or insert) a per-channel pts value.
Sourcepub fn channel_pts(&self, channel_id: i64) -> i32
pub fn channel_pts(&self, channel_id: i64) -> i32
Look up the stored pts for a channel, returns 0 if unknown.
Trait Implementations§
Source§impl Clone for UpdatesStateSnap
impl Clone for UpdatesStateSnap
Source§fn clone(&self) -> UpdatesStateSnap
fn clone(&self) -> UpdatesStateSnap
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UpdatesStateSnap
impl Debug for UpdatesStateSnap
Source§impl Default for UpdatesStateSnap
impl Default for UpdatesStateSnap
Source§fn default() -> UpdatesStateSnap
fn default() -> UpdatesStateSnap
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for UpdatesStateSnap
impl<'de> Deserialize<'de> for UpdatesStateSnap
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for UpdatesStateSnap
impl RefUnwindSafe for UpdatesStateSnap
impl Send for UpdatesStateSnap
impl Sync for UpdatesStateSnap
impl Unpin for UpdatesStateSnap
impl UnsafeUnpin for UpdatesStateSnap
impl UnwindSafe for UpdatesStateSnap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more