Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.

Commit 09ead62

Browse files
committed
glib: Add a method to Class<T> to get the wrapped C struct
This makes it easier/safer to implement `IsSubclassable`. This does not (yet) rewrite all the relevant code to use this method.
1 parent 2e84e8c commit 09ead62

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

glib/src/object.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2513,6 +2513,11 @@ impl<T: ObjectType> Class<T> {
25132513
}
25142514
}
25152515
}
2516+
2517+
/// Gets the contained type struct
2518+
pub fn inner(&mut self) -> &mut T::GlibClassType {
2519+
&mut self.0
2520+
}
25162521
}
25172522

25182523
unsafe impl<T: ObjectType> Send for Class<T> { }

0 commit comments

Comments
 (0)