From 5870b6c27b98217a107503885fd89a48a155a8db Mon Sep 17 00:00:00 2001 From: Ville Hakulinen Date: Sat, 30 Mar 2024 18:30:36 +0200 Subject: [PATCH 1/2] docs: `construct` attribute for `glib::Properties` --- glib-macros/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/glib-macros/src/lib.rs b/glib-macros/src/lib.rs index 915a5f7001e3..1eb0e10e48b3 100644 --- a/glib-macros/src/lib.rs +++ b/glib-macros/src/lib.rs @@ -1242,6 +1242,7 @@ pub fn cstr_bytes(item: TokenStream) -> TokenStream { /// | `override_interface = expr` | The type of interface of which to override the property from | | `#[property(override_interface = SomeInterface)]` | /// | `nullable` | Whether to use `Option` in the generated setter method | | `#[property(nullable)]` | /// | `member = ident` | Field of the nested type where property is retrieved and set | | `#[property(member = author)]` | +/// | `construct` | Specify that the property is construct property. Ensures that the property is always set during construction (if not explicilty then the default value is used). The use of a custom internal setter is supported. | | `#[property(get, construct)]` or `#[property(get, set = set_prop, construct)]` | /// | `construct_only` | Specify that the property is construct only. This will not generate a public setter and only allow the property to be set during object construction. The use of a custom internal setter is supported. | | `#[property(get, construct_only)]` or `#[property(get, set = set_prop, construct_only)]` | /// | `builder()[.ident]*` | Used to input required params or add optional Param Spec builder fields | | `#[property(builder(SomeEnum::default()))]`, `#[builder().default_value(1).minimum(0).maximum(5)]`, etc. | /// | `default` | Sets the `default_value` field of the Param Spec builder | | `#[property(default = 1)]` | From cb60975a1170a3807e222bba82d067c277c299a9 Mon Sep 17 00:00:00 2001 From: Ville Hakulinen Date: Sun, 31 Mar 2024 12:16:30 +0300 Subject: [PATCH 2/2] docs: fix typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastian Dröge --- glib-macros/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib-macros/src/lib.rs b/glib-macros/src/lib.rs index 1eb0e10e48b3..564ad408b7e1 100644 --- a/glib-macros/src/lib.rs +++ b/glib-macros/src/lib.rs @@ -1242,7 +1242,7 @@ pub fn cstr_bytes(item: TokenStream) -> TokenStream { /// | `override_interface = expr` | The type of interface of which to override the property from | | `#[property(override_interface = SomeInterface)]` | /// | `nullable` | Whether to use `Option` in the generated setter method | | `#[property(nullable)]` | /// | `member = ident` | Field of the nested type where property is retrieved and set | | `#[property(member = author)]` | -/// | `construct` | Specify that the property is construct property. Ensures that the property is always set during construction (if not explicilty then the default value is used). The use of a custom internal setter is supported. | | `#[property(get, construct)]` or `#[property(get, set = set_prop, construct)]` | +/// | `construct` | Specify that the property is construct property. Ensures that the property is always set during construction (if not explicitly then the default value is used). The use of a custom internal setter is supported. | | `#[property(get, construct)]` or `#[property(get, set = set_prop, construct)]` | /// | `construct_only` | Specify that the property is construct only. This will not generate a public setter and only allow the property to be set during object construction. The use of a custom internal setter is supported. | | `#[property(get, construct_only)]` or `#[property(get, set = set_prop, construct_only)]` | /// | `builder()[.ident]*` | Used to input required params or add optional Param Spec builder fields | | `#[property(builder(SomeEnum::default()))]`, `#[builder().default_value(1).minimum(0).maximum(5)]`, etc. | /// | `default` | Sets the `default_value` field of the Param Spec builder | | `#[property(default = 1)]` |