Skip to content

Commit 3581e84

Browse files
committed
glib-macros: extend Properties docs with the getter-setter docs
1 parent bf86950 commit 3581e84

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

glib-macros/src/lib.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1346,7 +1346,7 @@ pub fn cstr_bytes(item: TokenStream) -> TokenStream {
13461346
///
13471347
/// # Documentation
13481348
///
1349-
/// Doc comments preceding a `#[property]` attribute will be copied to the generated getter method.
1349+
/// Doc comments preceding a `#[property]` attribute will be copied to the generated getter and setter methods. You can specify different comments by the getter and setter by using `# Getter` and `# Setter` headings. The text under the header will be copied to the respective method.
13501350
///
13511351
/// ## Extension trait
13521352
/// You can choose to move the method definitions to a trait by using `#[properties(wrapper_type = super::MyType, ext_trait = MyTypePropertiesExt)]`.
@@ -1426,6 +1426,15 @@ pub fn cstr_bytes(item: TokenStream) -> TokenStream {
14261426
/// optional: RefCell<Option<String>>,
14271427
/// #[property(get, set)]
14281428
/// smart_pointer: Rc<RefCell<String>>,
1429+
/// /// # Getter
1430+
/// ///
1431+
/// /// Get the value of the property `extra_comments`
1432+
/// ///
1433+
/// /// # Setter
1434+
/// ///
1435+
/// /// This is the comment for the setter of the `extra_comments` field.
1436+
/// #[property(get, set)]
1437+
/// extra_comments: RefCell<bool>,
14291438
/// }
14301439
///
14311440
/// #[glib::derived_properties]

0 commit comments

Comments
 (0)