pub enum ConnectionState {
Connecting(ConnectionStateConnecting),
ConnectingToProxy(ConnectionStateConnectingToProxy),
Ready(ConnectionStateReady),
Updating(ConnectionStateUpdating),
WaitingForNetwork(ConnectionStateWaitingForNetwork),
// some variants omitted
}
Expand description
Describes the current state of the connection to Telegram servers
Variants§
Connecting(ConnectionStateConnecting)
Currently establishing a connection to the Telegram servers
ConnectingToProxy(ConnectionStateConnectingToProxy)
Currently establishing a connection with a proxy server
Ready(ConnectionStateReady)
There is a working connection to the Telegram servers
Updating(ConnectionStateUpdating)
Downloading data received while the application was offline
WaitingForNetwork(ConnectionStateWaitingForNetwork)
Currently waiting for the network to become available. Use setNetworkType to change the available network type
Implementations§
Source§impl ConnectionState
impl ConnectionState
pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self>
pub fn is_connecting(&self) -> bool
pub fn is_connecting_to_proxy(&self) -> bool
pub fn is_ready(&self) -> bool
pub fn is_updating(&self) -> bool
pub fn is_waiting_for_network(&self) -> bool
pub fn on_connecting<F: FnOnce(&ConnectionStateConnecting)>( &self, fnc: F, ) -> &Self
pub fn on_connecting_to_proxy<F: FnOnce(&ConnectionStateConnectingToProxy)>( &self, fnc: F, ) -> &Self
pub fn on_ready<F: FnOnce(&ConnectionStateReady)>(&self, fnc: F) -> &Self
pub fn on_updating<F: FnOnce(&ConnectionStateUpdating)>(&self, fnc: F) -> &Self
pub fn on_waiting_for_network<F: FnOnce(&ConnectionStateWaitingForNetwork)>( &self, fnc: F, ) -> &Self
pub fn as_connecting(&self) -> Option<&ConnectionStateConnecting>
pub fn as_connecting_to_proxy( &self, ) -> Option<&ConnectionStateConnectingToProxy>
pub fn as_ready(&self) -> Option<&ConnectionStateReady>
pub fn as_updating(&self) -> Option<&ConnectionStateUpdating>
pub fn as_waiting_for_network( &self, ) -> Option<&ConnectionStateWaitingForNetwork>
pub fn connecting<T: AsRef<ConnectionStateConnecting>>(t: T) -> Self
pub fn connecting_to_proxy<T: AsRef<ConnectionStateConnectingToProxy>>( t: T, ) -> Self
pub fn ready<T: AsRef<ConnectionStateReady>>(t: T) -> Self
pub fn updating<T: AsRef<ConnectionStateUpdating>>(t: T) -> Self
pub fn waiting_for_network<T: AsRef<ConnectionStateWaitingForNetwork>>( t: T, ) -> Self
Trait Implementations§
Source§impl AsRef<ConnectionState> for ConnectionState
impl AsRef<ConnectionState> for ConnectionState
Source§fn as_ref(&self) -> &ConnectionState
fn as_ref(&self) -> &ConnectionState
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for ConnectionState
impl Clone for ConnectionState
Source§fn clone(&self) -> ConnectionState
fn clone(&self) -> ConnectionState
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 ConnectionState
impl Debug for ConnectionState
Source§impl Default for ConnectionState
impl Default for ConnectionState
Source§impl<'de> Deserialize<'de> for ConnectionState
impl<'de> Deserialize<'de> for ConnectionState
Source§fn deserialize<D>(deserializer: D) -> Result<ConnectionState, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<ConnectionState, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl RObject for ConnectionState
impl RObject for ConnectionState
Auto Trait Implementations§
impl Freeze for ConnectionState
impl RefUnwindSafe for ConnectionState
impl Send for ConnectionState
impl Sync for ConnectionState
impl Unpin for ConnectionState
impl UnwindSafe for ConnectionState
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