Struct passcod_networkmanager::connection::Connection
source · pub struct Connection { /* private fields */ }Expand description
A connection profile.
See Device::reapply() for the difference between a
Connection and an [AppliedConnection].
Implementations§
source§impl Connection
impl Connection
sourcepub async fn update(
&self,
properties: HashMap<&str, HashMap<&str, Value<'_>>>
) -> Result<(), Error>
pub async fn update( &self, properties: HashMap<&str, HashMap<&str, Value<'_>>> ) -> Result<(), Error>
Update the connection with new settings and properties and save the connection to disk.
This replaces all previous settings and properties.
Secrets may be part of the update request, and will be either stored in persistent storage or sent to a Secret Agent for storage, depending on the flags associated with each secret.
sourcepub async fn update_in_memory(
&self,
properties: HashMap<&str, HashMap<&str, Value<'_>>>
) -> Result<(), Error>
pub async fn update_in_memory( &self, properties: HashMap<&str, HashMap<&str, Value<'_>>> ) -> Result<(), Error>
Update the connection with new settings and properties, but do not immediately save the connection to disk.
This replaces all previous settings and properties.
Secrets may be part of the update request and may sent to a Secret Agent for storage, depending on the flags associated with each secret.
Use the Connection::save() method to save these changes to disk.
Note that unsaved changes will be lost if the connection is reloaded from disk (either
automatically on file change or due to an explicit ReloadConnections call).
sourcepub async fn settings(
&self
) -> Result<HashMap<String, HashMap<String, OwnedValue>>, Error>
pub async fn settings( &self ) -> Result<HashMap<String, HashMap<String, OwnedValue>>, Error>
Get the settings maps describing this network configuration.
This will never include any secrets required for connection to the network, as those are
often protected. Secrets must be requested separately using the GetSecrets call.
sourcepub async fn secrets(
&self
) -> Result<HashMap<String, HashMap<String, OwnedValue>>, Error>
pub async fn secrets( &self ) -> Result<HashMap<String, HashMap<String, OwnedValue>>, Error>
Get the secrets belonging to this network configuration.
Only secrets from persistent storage or a Secret Agent running in the requestor’s session will be returned. The user will never be prompted for secrets as a result of this request.
sourcepub async fn secrets_for_setting(
&self,
setting_name: &str
) -> Result<HashMap<String, HashMap<String, OwnedValue>>, Error>
pub async fn secrets_for_setting( &self, setting_name: &str ) -> Result<HashMap<String, HashMap<String, OwnedValue>>, Error>
Get the secrets belonging to this network configuration, for a particular setting.
Only secrets from persistent storage or a Secret Agent running in the requestor’s session will be returned. The user will never be prompted for secrets as a result of this request.
sourcepub async fn clear_secrets(&self) -> Result<(), Error>
pub async fn clear_secrets(&self) -> Result<(), Error>
Clear the secrets belonging to this network connection profile.
sourcepub async fn save(&self) -> Result<(), Error>
pub async fn save(&self) -> Result<(), Error>
Save a connection previously updated with Connection::update_in_memory() to persistent storage.
sourcepub async fn is_saved(&self) -> Result<bool, Error>
pub async fn is_saved(&self) -> Result<bool, Error>
Indicates whether the in-memory state of the connection matches the on-disk state.
This flag will be unset when Connection::update_in_memory() is called or when any
connection details change, and set when the connection is saved to disk via
Connection::save() or from internal operations.
sourcepub async fn flags(&self) -> Result<ConnectionFlags, Error>
pub async fn flags(&self) -> Result<ConnectionFlags, Error>
Additional flags of the connection profile.
Trait Implementations§
source§impl Clone for Connection
impl Clone for Connection
source§fn clone(&self) -> Connection
fn clone(&self) -> Connection
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more