SettingExt

Trait SettingExt 

Source
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

Provided Methods§

Source

fn compare(&self, b: &impl IsA<Setting>, flags: SettingCompareFlags) -> bool

Source

fn duplicate(&self) -> Setting

Duplicates a #NMSetting.

§Returns

a new #NMSetting containing the same properties and values as the source #NMSetting

Source

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’.

Source

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

Source

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

Source

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()

Source

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

true if the setting is valid, false if it is not

Source

fn verify_secrets( &self, connection: Option<&impl IsA<Connection>>, ) -> Result<(), Error>

Available on crate feature 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

Source

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.

Implementors§