pub struct SavedNetworksManager { /* private fields */ }Expand description
The Saved Network Manager keeps track of saved networks and provides thread-safe access to saved networks. Networks are saved by NetworkConfig and accessed by their NetworkIdentifier (SSID and security protocol). Network configs are saved in-memory, and part of each network data is saved persistently. Futures aware locks are used in order to wait for the storage flush operations to complete when data changes.
Implementations§
Source§impl SavedNetworksManager
impl SavedNetworksManager
Sourcepub async fn new(telemetry_sender: TelemetrySender) -> Self
pub async fn new(telemetry_sender: TelemetrySender) -> Self
Initializes a new Saved Network Manager by reading saved networks from local storage using a WLAN helper library. It will attempt to migrate any data from legacy storage.
Sourcepub async fn new_with_storage(
store: PolicyStorage,
telemetry_sender: TelemetrySender,
) -> Self
pub async fn new_with_storage( store: PolicyStorage, telemetry_sender: TelemetrySender, ) -> Self
Load data from persistent storage. The legacy stash data is deleted if it exists.
Trait Implementations§
Source§impl SavedNetworksManagerApi for SavedNetworksManager
impl SavedNetworksManagerApi for SavedNetworksManager
Source§fn known_network_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = usize> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn known_network_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = usize> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the count of networks in store, including multiple values with same SSID
Source§fn lookup<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 NetworkIdentifier,
) -> Pin<Box<dyn Future<Output = Vec<NetworkConfig>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn lookup<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 NetworkIdentifier,
) -> Pin<Box<dyn Future<Output = Vec<NetworkConfig>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return the network configs that have this network identifier. The configs may be different because of their credentials. Note that these are copies of the current data, so if data could have changed it should be looked up again. For example, data about roam scans change throughout a connection so callers cannot keep using the same network config for that data throughout the connection.
Source§fn is_network_single_bss<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 NetworkIdentifier,
credential: &'life2 Credential,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn is_network_single_bss<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 NetworkIdentifier,
credential: &'life2 Credential,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Returns whether or not the network likely has only one BSS based on previous scans. This should be used instead of the network config if the network config may have been updated. For example, when making roam scan decisions this should be used instead of a network config obtained at the time of connecting.
Source§fn remove<'life0, 'async_trait>(
&'life0 self,
network_id: NetworkIdentifier,
credential: Credential,
) -> Pin<Box<dyn Future<Output = Result<bool, NetworkConfigError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn remove<'life0, 'async_trait>(
&'life0 self,
network_id: NetworkIdentifier,
credential: Credential,
) -> Pin<Box<dyn Future<Output = Result<bool, NetworkConfigError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn lookup_compatible<'life0, 'life1, 'async_trait>(
&'life0 self,
ssid: &'life1 Ssid,
scan_security: SecurityTypeDetailed,
) -> Pin<Box<dyn Future<Output = Vec<NetworkConfig>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn lookup_compatible<'life0, 'life1, 'async_trait>(
&'life0 self,
ssid: &'life1 Ssid,
scan_security: SecurityTypeDetailed,
) -> Pin<Box<dyn Future<Output = Vec<NetworkConfig>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn store<'life0, 'async_trait>(
&'life0 self,
network_id: NetworkIdentifier,
credential: Credential,
) -> Pin<Box<dyn Future<Output = Result<Option<NetworkConfig>, NetworkConfigError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn store<'life0, 'async_trait>(
&'life0 self,
network_id: NetworkIdentifier,
credential: Credential,
) -> Pin<Box<dyn Future<Output = Result<Option<NetworkConfig>, NetworkConfigError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn record_connect_result<'life0, 'life1, 'async_trait>(
&'life0 self,
id: NetworkIdentifier,
credential: &'life1 Credential,
bssid: Bssid,
connect_result: ConnectResult,
scan_type: ScanObservation,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn record_connect_result<'life0, 'life1, 'async_trait>(
&'life0 self,
id: NetworkIdentifier,
credential: &'life1 Credential,
bssid: Bssid,
connect_result: ConnectResult,
scan_type: ScanObservation,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn record_disconnect<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 NetworkIdentifier,
credential: &'life2 Credential,
data: PastConnectionData,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn record_disconnect<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 NetworkIdentifier,
credential: &'life2 Credential,
data: PastConnectionData,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn record_periodic_metrics<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn record_scan_result<'life0, 'life1, 'async_trait>(
&'life0 self,
target_ssids: Vec<Ssid>,
results: &'life1 HashMap<NetworkIdentifierDetailed, Vec<Bss>>,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn record_scan_result<'life0, 'life1, 'async_trait>(
&'life0 self,
target_ssids: Vec<Ssid>,
results: &'life1 HashMap<NetworkIdentifierDetailed, Vec<Bss>>,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_networks<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<NetworkConfig>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_past_connections<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
id: &'life1 NetworkIdentifier,
credential: &'life2 Credential,
bssid: &'life3 Bssid,
) -> Pin<Box<dyn Future<Output = PastConnectionList> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Auto Trait Implementations§
impl !Freeze for SavedNetworksManager
impl !RefUnwindSafe for SavedNetworksManager
impl Send for SavedNetworksManager
impl Sync for SavedNetworksManager
impl Unpin for SavedNetworksManager
impl !UnwindSafe for SavedNetworksManager
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
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to [Self]§impl<T> IntoAny for T
impl<T> IntoAny for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more