Skip to content

Commit a859829

Browse files
authored
Merge pull request #832 from sdroege/object-impl-property-guarantees
glib: Document the value guarantees for `ObjectImpl::set_property()` …
2 parents efa9e6c + 06908ee commit a859829

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)