We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 64d4ee6 commit f00edfbCopy full SHA for f00edfb
crates/cxx-qt/src/lib.rs
@@ -178,6 +178,28 @@ pub trait Upcast<T> {
178
}
179
180
181
+impl<T> Upcast<T> for T {
182
+ unsafe fn upcast_ptr(this: *const Self) -> *const Self {
183
+ this
184
+ }
185
+
186
+ unsafe fn from_base_ptr(base: *const T) -> *const Self {
187
+ base
188
189
190
+ fn upcast(&self) -> &Self {
191
+ self
192
193
194
+ fn upcast_mut(&mut self) -> &mut Self {
195
196
197
198
+ fn upcast_pin(self: Pin<&mut Self>) -> Pin<&mut Self> {
199
200
201
+}
202
203
/// This trait is automatically implemented by CXX-Qt and you most likely do not need to manually implement it.
204
/// Trait for downcasting to a subclass, provided the subclass implements [Upcast] to this type.
205
/// Returns `None` in cases where `Sub` isn't a child class of `Self`.
0 commit comments