pub trait HSTSEnforcerExt: IsA<HSTSEnforcer> + Sealed + 'static {
    // Provided methods
    fn domains(&self, session_policies: bool) -> Vec<GString> { ... }
    fn policies(&self, session_policies: bool) -> Vec<HSTSPolicy> { ... }
    fn has_valid_policy(&self, domain: &str) -> bool { ... }
    fn is_persistent(&self) -> bool { ... }
    fn set_policy(&self, policy: &mut HSTSPolicy) { ... }
    fn set_session_policy(&self, domain: &str, include_subdomains: bool) { ... }
    fn connect_changed<F: Fn(&Self, &HSTSPolicy, &HSTSPolicy) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all HSTSEnforcer methods.

§Implementors

HSTSEnforcerDB, HSTSEnforcer

Provided Methods§

source

fn domains(&self, session_policies: bool) -> Vec<GString>

Gets a list of domains for which there are policies in @enforcer.

§session_policies

whether to include session policies

§Returns

a newly allocated list of domains. Use [glib::List::free_full()][crate::glib::List::free_full()] and free() to free the list.

source

fn policies(&self, session_policies: bool) -> Vec<HSTSPolicy>

Gets a list with the policies in @enforcer.

§session_policies

whether to include session policies

§Returns

a newly allocated list of policies. Use [glib::List::free_full()][crate::glib::List::free_full()] and HSTSPolicy::free() to free the list.

source

fn has_valid_policy(&self, domain: &str) -> bool

Gets whether @self has a currently valid policy for @domain.

§domain

a domain.

§Returns

true if access to @domain should happen over HTTPS, false otherwise.

source

fn is_persistent(&self) -> bool

Gets whether @self stores policies persistenly.

§Returns

true if @self storage is persistent or false otherwise.

source

fn set_policy(&self, policy: &mut HSTSPolicy)

Sets @policy to @self.

If @policy is expired, any existing HSTS policy for its host will be removed instead. If a policy existed for this host, it will be replaced. Otherwise, the new policy will be inserted. If the policy is a session policy, that is, one created with HSTSPolicy::new_session_policy(), the policy will not expire and will be enforced during the lifetime of @self’s Session.

§policy

the policy of the HSTS host

source

fn set_session_policy(&self, domain: &str, include_subdomains: bool)

Sets a session policy for @domain.

A session policy is a policy that is permanent to the lifetime of @self’s Session and doesn’t expire.

§domain

policy domain or hostname

§include_subdomains

true if the policy applies on sub domains

source

fn connect_changed<F: Fn(&Self, &HSTSPolicy, &HSTSPolicy) + 'static>( &self, f: F ) -> SignalHandlerId

Emitted when @hsts_enforcer changes.

If a policy has been added, @new_policy will contain the newly-added policy and @old_policy will be None. If a policy has been deleted, @old_policy will contain the to-be-deleted policy and @new_policy will be None. If a policy has been changed, @old_policy will contain its old value, and @new_policy its new value.

Note that you shouldn’t modify the policies from a callback to this signal.

§old_policy

the old #SoupHSTSPolicy value

§new_policy

the new #SoupHSTSPolicy value

Object Safety§

This trait is not object safe.

Implementors§