pub struct NetworkConfig {
pub ssid: Ssid,
pub security_type: SecurityType,
pub credential: Credential,
pub has_ever_connected: bool,
pub hidden_probability: f32,
pub perf_stats: PerformanceStats,
/* private fields */
}
Expand description
Saved data for networks, to remember how to connect to a network and determine if we should.
Fields§
§ssid: Ssid
(persist) SSID and security type to identify a network.
security_type: SecurityType
§credential: Credential
(persist) Credential to connect to a protected network or None if the network is open.
has_ever_connected: bool
(persist) Remember whether our network indentifier and credential work.
How confident we are that this network is hidden, between 0 and 1. We will use this number to probabilistically perform an active scan for the network. This is persisted to maintain consistent behavior between reboots. 0 means not hidden.
perf_stats: PerformanceStats
Used to estimate quality to determine whether we want to choose this network.
Implementations§
source§impl NetworkConfig
impl NetworkConfig
sourcepub fn new(
id: NetworkIdentifier,
credential: Credential,
has_ever_connected: bool
) -> Result<Self, NetworkConfigError>
pub fn new( id: NetworkIdentifier, credential: Credential, has_ever_connected: bool ) -> Result<Self, NetworkConfigError>
A new network config is created by loading from persistent storage on boot or when a new network is saved.
Trait Implementations§
source§impl Clone for NetworkConfig
impl Clone for NetworkConfig
source§fn clone(&self) -> NetworkConfig
fn clone(&self) -> NetworkConfig
Returns a copy 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 NetworkConfig
impl Debug for NetworkConfig
source§impl From<&NetworkConfig> for NetworkConfig
impl From<&NetworkConfig> for NetworkConfig
source§fn from(network_config: &NetworkConfig) -> Self
fn from(network_config: &NetworkConfig) -> Self
Converts to this type from the input type.
source§impl From<NetworkConfig> for NetworkConfig
impl From<NetworkConfig> for NetworkConfig
source§fn from(config: NetworkConfig) -> Self
fn from(config: NetworkConfig) -> Self
Converts to this type from the input type.
source§impl From<NetworkConfig> for PersistentData
impl From<NetworkConfig> for PersistentData
source§fn from(item: NetworkConfig) -> Self
fn from(item: NetworkConfig) -> Self
Converts to this type from the input type.
source§impl PartialEq for NetworkConfig
impl PartialEq for NetworkConfig
source§fn eq(&self, other: &NetworkConfig) -> bool
fn eq(&self, other: &NetworkConfig) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for NetworkConfig
Auto Trait Implementations§
impl Freeze for NetworkConfig
impl RefUnwindSafe for NetworkConfig
impl Send for NetworkConfig
impl Sync for NetworkConfig
impl Unpin for NetworkConfig
impl UnwindSafe for NetworkConfig
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