pub struct DcOption {
pub id: i32,
pub ipv4: SocketAddrV4,
pub ipv6: SocketAddrV6,
pub auth_key: Option<[u8; 256]>,
}Expand description
A datacenter option.
This is very similar to Telegram’s own dcOption type, except it also
contains the permanent authentication key and serves as a stable interface.
Fields§
§id: i32Datacenter identifier.
The primary datacenters have IDs from 1 to 5 inclusive, and are known statically by the session.
let data = grammers_session::SessionData::default();
assert_eq!(data.dc_options.len(), 5);
(1..=5).for_each(|dc_id| assert!(data.dc_options.contains_key(&dc_id)));ipv4: SocketAddrV4IPv4 address corresponding to this datacenter.
ipv6: SocketAddrV6IPv6 address corresponding to this datacenter. May actually be embedding the Self::ipv4 address.
auth_key: Option<[u8; 256]>Permanent authentication key generated for encrypted communication with this datacenter.
A logged-in user may or not be bound to this authentication key.
Trait Implementations§
impl Eq for DcOption
impl StructuralPartialEq for DcOption
Auto Trait Implementations§
impl Freeze for DcOption
impl RefUnwindSafe for DcOption
impl Send for DcOption
impl Sync for DcOption
impl Unpin for DcOption
impl UnwindSafe for DcOption
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