pub struct MemorySession(/* private fields */);Expand description
In-memory session interface.
Does not actually offer direct ways to persist the state anywhere, so it should only be used in very few select cases.
Logging in has a very high cost in terms of flood wait errors, so the state really should be persisted by other means.
Trait Implementations§
Source§impl Default for MemorySession
impl Default for MemorySession
Source§fn default() -> MemorySession
fn default() -> MemorySession
Returns the “default value” for a type. Read more
Source§impl From<SessionData> for MemorySession
impl From<SessionData> for MemorySession
Source§fn from(session_data: SessionData) -> Self
fn from(session_data: SessionData) -> Self
Constructs a memory session from the entirety of the session data,
unlike the blanket From implementation which cannot import all values
Source§impl Session for MemorySession
impl Session for MemorySession
Source§fn home_dc_id(&self) -> i32
fn home_dc_id(&self) -> i32
Datacenter that is “home” to the user authorized by this session. Read more
Source§fn set_home_dc_id(&self, dc_id: i32)
fn set_home_dc_id(&self, dc_id: i32)
Changes the
Session::home_dc_id after finding out the actual datacenter
to which main queries should be executed against.Source§fn dc_option(&self, dc_id: i32) -> Option<DcOption>
fn dc_option(&self, dc_id: i32) -> Option<DcOption>
Query a single datacenter option. Read more
Source§fn set_dc_option(&self, dc_option: &DcOption)
fn set_dc_option(&self, dc_option: &DcOption)
Update the previously-known
Session::dc_option with new values. Read moreSource§fn cache_peer(&self, peer: &PeerInfo)
fn cache_peer(&self, peer: &PeerInfo)
Cache a peer’s basic information for
Session::peer to be able to query them later. Read moreSource§fn updates_state(&self) -> UpdatesState
fn updates_state(&self) -> UpdatesState
Loads the entire updates state.
Source§fn set_update_state(&self, update: UpdateState)
fn set_update_state(&self, update: UpdateState)
Update the state for one or all updates.
Auto Trait Implementations§
impl !Freeze for MemorySession
impl RefUnwindSafe for MemorySession
impl Send for MemorySession
impl Sync for MemorySession
impl Unpin for MemorySession
impl UnwindSafe for MemorySession
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