gtk4/
bookmark_list.rs
1use glib::translate::*;
4
5use crate::{ffi, BookmarkList};
6
7impl BookmarkList {
8 #[doc(alias = "gtk_bookmark_list_get_io_priority")]
14 #[doc(alias = "get_io_priority")]
15 pub fn io_priority(&self) -> glib::Priority {
16 unsafe {
17 from_glib(ffi::gtk_bookmark_list_get_io_priority(
18 self.to_glib_none().0,
19 ))
20 }
21 }
22
23 #[doc(alias = "gtk_bookmark_list_set_io_priority")]
29 pub fn set_io_priority(&self, io_priority: glib::Priority) {
30 unsafe {
31 ffi::gtk_bookmark_list_set_io_priority(self.to_glib_none().0, io_priority.into_glib());
32 }
33 }
34
35 pub fn builder() -> BookmarkListBuilder {
43 BookmarkListBuilder::new()
44 }
45}
46
47#[must_use = "The builder must be built to be used"]
52pub struct BookmarkListBuilder {
53 builder: glib::object::ObjectBuilder<'static, BookmarkList>,
54}
55
56impl BookmarkListBuilder {
57 fn new() -> Self {
58 Self {
59 builder: glib::object::Object::builder(),
60 }
61 }
62
63 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
64 pub fn build(self) -> BookmarkList {
65 self.builder.build()
66 }
67
68 pub fn attributes(self, attributes: &str) -> Self {
69 Self {
70 builder: self.builder.property("attributes", attributes),
71 }
72 }
73
74 pub fn filename(self, filename: &str) -> Self {
75 Self {
76 builder: self.builder.property("filename", filename),
77 }
78 }
79
80 pub fn io_priority(self, io_priority: glib::Priority) -> Self {
81 Self {
82 builder: self
83 .builder
84 .property("io-priority", io_priority.into_glib()),
85 }
86 }
87}