soup/auto/
auth_basic.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};
7use glib::prelude::*;
8
9glib::wrapper! {
10    #[doc(alias = "SoupAuthBasic")]
11    pub struct AuthBasic(Object<ffi::SoupAuthBasic>) @extends Auth;
12
13    match fn {
14        type_ => || ffi::soup_auth_basic_get_type(),
15    }
16}
17
18impl AuthBasic {
19    // rustdoc-stripper-ignore-next
20    /// Creates a new builder-pattern struct instance to construct [`AuthBasic`] objects.
21    ///
22    /// This method returns an instance of [`AuthBasicBuilder`](crate::builders::AuthBasicBuilder) which can be used to create [`AuthBasic`] objects.
23    pub fn builder() -> AuthBasicBuilder {
24        AuthBasicBuilder::new()
25    }
26}
27
28// rustdoc-stripper-ignore-next
29/// A [builder-pattern] type to construct [`AuthBasic`] objects.
30///
31/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
32#[must_use = "The builder must be built to be used"]
33pub struct AuthBasicBuilder {
34    builder: glib::object::ObjectBuilder<'static, AuthBasic>,
35}
36
37impl AuthBasicBuilder {
38    fn new() -> Self {
39        Self {
40            builder: glib::object::Object::builder(),
41        }
42    }
43
44    pub fn authority(self, authority: impl Into<glib::GString>) -> Self {
45        Self {
46            builder: self.builder.property("authority", authority.into()),
47        }
48    }
49
50    pub fn is_for_proxy(self, is_for_proxy: bool) -> Self {
51        Self {
52            builder: self.builder.property("is-for-proxy", is_for_proxy),
53        }
54    }
55
56    pub fn realm(self, realm: impl Into<glib::GString>) -> Self {
57        Self {
58            builder: self.builder.property("realm", realm.into()),
59        }
60    }
61
62    // rustdoc-stripper-ignore-next
63    /// Build the [`AuthBasic`].
64    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
65    pub fn build(self) -> AuthBasic {
66        self.builder.build()
67    }
68}