pub trait SettingExt: IsA<Setting> + 'static {
// Provided methods
fn compare(&self, b: &impl IsA<Setting>, flags: SettingCompareFlags) -> bool { ... }
fn duplicate(&self) -> Setting { ... }
fn name(&self) -> GString { ... }
fn secret_flags(
&self,
secret_name: &str,
out_flags: SettingSecretFlags,
) -> Result<(), Error> { ... }
fn set_secret_flags(
&self,
secret_name: &str,
flags: SettingSecretFlags,
) -> Result<(), Error> { ... }
fn to_str(&self) -> GString { ... }
fn verify(
&self,
connection: Option<&impl IsA<Connection>>,
) -> Result<(), Error> { ... }
fn verify_secrets(
&self,
connection: Option<&impl IsA<Connection>>,
) -> Result<(), Error> { ... }
fn connect_name_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}Expand description
Trait containing all Setting methods.
§Implementors
Setting6Lowpan, Setting8021x, SettingAdsl, SettingBluetooth, SettingBondPort, SettingBond, SettingBridgePort, SettingBridge, SettingCdma, SettingConnection, SettingDcb, SettingDummy, SettingEthtool, SettingGeneric, SettingGsm, [SettingHostname][struct@crate::SettingHostname], SettingHsr, SettingIPConfig, SettingIPTunnel, SettingInfiniband, SettingIpvlan, [SettingLink][struct@crate::SettingLink], SettingLoopback, SettingMacsec, SettingMacvlan, SettingMatch, SettingOlpcMesh, SettingOvsBridge, SettingOvsDpdk, SettingOvsExternalIDs, SettingOvsOtherConfig, SettingOvsPatch, SettingOvsPort, SettingPpp, SettingPppoe, [SettingPrefixDelegation][struct@crate::SettingPrefixDelegation], SettingProxy, SettingSerial, SettingSriov, SettingTCConfig, SettingTeamPort, SettingTeam, SettingTun, SettingUser, SettingVeth, SettingVlan, SettingVpn, [SettingVrf][struct@crate::SettingVrf], SettingVxlan, SettingWifiP2P, SettingWimax, SettingWireGuard, SettingWired, SettingWirelessSecurity, SettingWireless, SettingWpan, Setting
Provided Methods§
fn compare(&self, b: &impl IsA<Setting>, flags: SettingCompareFlags) -> bool
Sourcefn duplicate(&self) -> Setting
fn duplicate(&self) -> Setting
Duplicates a #NMSetting.
§Returns
a new #NMSetting containing the same properties and values as the source #NMSetting
Sourcefn name(&self) -> GString
fn name(&self) -> GString
Returns the type name of the #NMSetting object
§Returns
a string containing the type name of the #NMSetting object, like ‘ppp’ or ‘wireless’ or ‘wired’.
Sourcefn secret_flags(
&self,
secret_name: &str,
out_flags: SettingSecretFlags,
) -> Result<(), Error>
fn secret_flags( &self, secret_name: &str, out_flags: SettingSecretFlags, ) -> Result<(), Error>
For a given secret, retrieves the #NMSettingSecretFlags describing how to handle that secret.
§secret_name
the secret key name to get flags for
§out_flags
on success, the #NMSettingSecretFlags for the secret
§Returns
true on success (if the given secret name was a valid property of
this setting, and if that property is secret), false if not
Sourcefn set_secret_flags(
&self,
secret_name: &str,
flags: SettingSecretFlags,
) -> Result<(), Error>
fn set_secret_flags( &self, secret_name: &str, flags: SettingSecretFlags, ) -> Result<(), Error>
For a given secret, stores the #NMSettingSecretFlags describing how to handle that secret.
§secret_name
the secret key name to set flags for
§flags
the #NMSettingSecretFlags for the secret
§Returns
true on success (if the given secret name was a valid property of
this setting, and if that property is secret), false if not
Sourcefn to_str(&self) -> GString
fn to_str(&self) -> GString
Convert the setting (including secrets!) into a string. For debugging purposes ONLY, should NOT be used for serialization of the setting, or machine-parsed in any way. The output format is not guaranteed to be stable and may change at any time.
§Returns
an allocated string containing a textual representation of the setting’s properties and values, which the caller should free with g_free()
Sourcefn verify(&self, connection: Option<&impl IsA<Connection>>) -> Result<(), Error>
fn verify(&self, connection: Option<&impl IsA<Connection>>) -> Result<(), Error>
Validates the setting. Each setting’s properties have allowed values, and some are dependent on other values (hence the need for @connection). The returned #GError contains information about which property of the setting failed validation, and in what way that property failed validation.
§connection
the #NMConnection that @self came from, or
None if @self is being verified in isolation.
§Returns
Sourcefn verify_secrets(
&self,
connection: Option<&impl IsA<Connection>>,
) -> Result<(), Error>
Available on crate feature v1_2 only.
fn verify_secrets( &self, connection: Option<&impl IsA<Connection>>, ) -> Result<(), Error>
v1_2 only.Verifies the secrets in the setting. The returned #GError contains information about which secret of the setting failed validation, and in what way that secret failed validation. The secret validation is done separately from main setting validation, because in some cases connection failure is not desired just for the secrets.
§connection
the #NMConnection that @self came from, or
None if @self is being verified in isolation.
§Returns
true if the setting secrets are valid, false if they are not
fn connect_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.