soup/auto/
auth_manager.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from
3// from gir-files (https://github.com/gtk-rs/gir-files)
4// DO NOT EDIT
5
6use crate::{ffi, Auth, SessionFeature};
7use glib::{prelude::*, translate::*};
8
9glib::wrapper! {
10    #[doc(alias = "SoupAuthManager")]
11    pub struct AuthManager(Object<ffi::SoupAuthManager, ffi::SoupAuthManagerClass>) @implements SessionFeature;
12
13    match fn {
14        type_ => || ffi::soup_auth_manager_get_type(),
15    }
16}
17
18impl AuthManager {
19    #[doc(alias = "soup_auth_manager_clear_cached_credentials")]
20    pub fn clear_cached_credentials(&self) {
21        unsafe {
22            ffi::soup_auth_manager_clear_cached_credentials(self.to_glib_none().0);
23        }
24    }
25
26    #[doc(alias = "soup_auth_manager_use_auth")]
27    pub fn use_auth(&self, uri: &glib::Uri, auth: &impl IsA<Auth>) {
28        unsafe {
29            ffi::soup_auth_manager_use_auth(
30                self.to_glib_none().0,
31                uri.to_glib_none().0,
32                auth.as_ref().to_glib_none().0,
33            );
34        }
35    }
36}