You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// | `name = "literal"` | The name of the property | field ident where `_` (leading and trailing `_` are trimmed) is replaced into `-` | `#[property(name = "prop-name")]` |
1221
1221
/// | `type = expr` | The type of the property | inferred | `#[property(type = i32)]` |
1222
-
/// | `get [= expr]` | Specify that the property is readable and use `PropertyGet::get` [or optionally set a custom internal getter] | | `#[property(get)]`, `#[property(get = get_prop)]`, or `[property(get = \|_\| 2)]` |
1223
-
/// | `set [= expr]` | Specify that the property is writable and use `PropertySet::set` [or optionally set a custom internal setter] | | `#[property(set)]`, `#[property(set = set_prop)]`, or `[property(set = \|_, val\| {})]` |
1222
+
/// | `get [= expr]` | Specify that the property is readable and use [`PropertyGet::get`] [or optionally set a custom internal getter] | | `#[property(get)]`, `#[property(get = get_prop)]`, or `[property(get = \|_\| 2)]` |
1223
+
/// | `set [= expr]` | Specify that the property is writable and use [`PropertySet::set`] [or optionally set a custom internal setter] | | `#[property(set)]`, `#[property(set = set_prop)]`, or `[property(set = \|_, val\| {})]` |
1224
1224
/// | `override_class = expr` | The type of class of which to override the property from | | `#[property(override_class = SomeClass)]` |
1225
1225
/// | `override_interface = expr` | The type of interface of which to override the property from | | `#[property(override_interface = SomeInterface)]` |
1226
1226
/// | `nullable` | Whether to use `Option<T>` in the generated setter method | | `#[property(nullable)]` |
/// by assigning an expression to `get`/`set` `#[property]` attributes: `#[property(get = |_| 2, set)]` or `#[property(get, set = custom_setter_func)]`.
1257
1257
///
1258
1258
/// # Supported types
1259
-
/// Every type implementing the trait `Property` is supported.
1260
-
/// The type `Option<T>` is supported as a property only if `Option<T>` implements `ToValueOptional`.
1259
+
/// Every type implementing the trait [`Property`] is supported.
1260
+
/// The type `Option<T>` is supported as a property only if `Option<T>` implements [`ToValueOptional`].
1261
1261
/// Optional types also require the `nullable` attribute: without it, the generated setter on the wrapper type
1262
1262
/// will take `T` instead of `Option<T>`, preventing the user from ever calling the setter with a `None` value.
1263
1263
///
1264
1264
/// ## Adding support for custom types
1265
-
/// ### Types wrapping an existing `T: glib::value::ToValue + glib::HasParamSpec`
1265
+
/// ### Types wrapping an existing <code>T: [ToValue] + [HasParamSpec]</code>
1266
1266
/// If you have declared a newtype as
1267
1267
/// ```rust
1268
1268
/// struct MyInt(i32);
1269
1269
/// ```
1270
-
/// you can use it as a property by deriving `glib::ValueDelegate`.
1270
+
/// you can use it as a property by deriving [`ValueDelegate`].
1271
1271
///
1272
1272
/// ### Types with inner mutability
1273
-
/// The trait `glib::Property` must be implemented.
1274
-
/// The traits `PropertyGet` and `PropertySet` should be implemented to enable the Properties macro
1273
+
/// The trait [`Property`] must be implemented.
1274
+
/// The traits [`PropertyGet`] and [`PropertySet`] should be implemented to enable the Properties macro
1275
1275
/// to generate a default internal getter/setter.
1276
-
/// If possible, implementing `PropertySetNested` is preferred over `PropertySet`, because it
1276
+
/// If possible, implementing [`PropertySetNested`] is preferred over `PropertySet`, because it
1277
1277
/// enables this macro to access the contained type and provide access to its fields,
1278
1278
/// using the `member = $structfield` syntax.
1279
1279
///
1280
-
/// ### Types without `glib::HasParamSpec`
1281
-
/// If you have encountered a type `T: glib::value::ToValue`, inside the `gtk-rs` crate, which doesn't implement `HasParamSpec`,
1280
+
/// ### Types without [`HasParamSpec`][HasParamSpec]
1281
+
/// If you have encountered a type <code>T: [ToValue]</code>, inside the gtk-rs crate, which doesn't implement [`HasParamSpec`][HasParamSpec],
1282
1282
/// then it's a bug and you should report it.
1283
-
/// If you need to support a `ToValue` type with a `ParamSpec` not provided by `gtk-rs`, then you need to
1284
-
/// implement `glib::HasParamSpec` on that type.
1283
+
/// If you need to support a `ToValue` type with a [`ParamSpec`] not provided by gtk-rs, then you need to
0 commit comments