Skip to content

Commit 06908ee

Browse files
committed
glib: Document the value guarantees for ObjectImpl::set_property() and property()
1 parent 684c326 commit 06908ee

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

glib/src/subclass/object.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ pub trait ObjectImpl: ObjectSubclass + ObjectImplExt {
3333
///
3434
/// This is called whenever the property of this specific subclass with the
3535
/// given index is set. The new value is passed as `glib::Value`.
36+
///
37+
/// `value` is guaranteed to be of the correct type for the given property.
3638
fn set_property(&self, _id: usize, _value: &Value, _pspec: &ParamSpec) {
3739
unimplemented!()
3840
}
@@ -42,6 +44,8 @@ pub trait ObjectImpl: ObjectSubclass + ObjectImplExt {
4244
///
4345
/// This is called whenever the property value of the specific subclass with the
4446
/// given index should be returned.
47+
///
48+
/// The returned `Value` must be of the correct type for the given property.
4549
#[doc(alias = "get_property")]
4650
fn property(&self, _id: usize, _pspec: &ParamSpec) -> Value {
4751
unimplemented!()

0 commit comments

Comments
 (0)