Lines Matching refs:T
132 unsafe impl<T: ObjectType> IsA<T> for T {} implementation
184 pub struct ParentField<T: ObjectType>(std::mem::ManuallyDrop<T>);
186 impl<T: ObjectType> Deref for ParentField<T> {
187 type Target = T;
195 impl<T: ObjectType> DerefMut for ParentField<T> {
202 impl<T: fmt::Display + ObjectType> fmt::Display for ParentField<T> {
209 unsafe extern "C" fn rust_instance_init<T: ObjectImpl>(obj: *mut bindings::Object) { in rust_instance_init()
210 let mut state = NonNull::new(obj).unwrap().cast::<T>(); in rust_instance_init()
215 T::INSTANCE_INIT.unwrap()(state.as_mut()); in rust_instance_init()
219 unsafe extern "C" fn rust_instance_post_init<T: ObjectImpl>(obj: *mut bindings::Object) { in rust_instance_post_init()
220 let state = NonNull::new(obj).unwrap().cast::<T>(); in rust_instance_post_init()
224 T::INSTANCE_POST_INIT.unwrap()(unsafe { state.as_ref() }); in rust_instance_post_init()
227 unsafe extern "C" fn rust_class_init<T: ObjectType + ObjectImpl>( in rust_class_init()
233 .cast::<<T as ObjectType>::Class>(); in rust_class_init()
237 <T as ObjectImpl>::CLASS_INIT(unsafe { klass.as_mut() }) in rust_class_init()
240 unsafe extern "C" fn drop_object<T: ObjectImpl>(obj: *mut bindings::Object) { in drop_object()
247 unsafe { std::ptr::drop_in_place(obj.cast::<T>()) } in drop_object()
462 impl<T: ObjectType> ObjectDeref for &T {} implementation
463 impl<T: ObjectType> ObjectCast for &T {} implementation
465 impl<T: ObjectType> ObjectDeref for &mut T {} implementation
549 unsafe extern "C" fn rust_unparent_fn<T: ObjectImpl>(dev: *mut bindings::Object) { in rust_unparent_fn()
550 let state = NonNull::new(dev).unwrap().cast::<T>(); in rust_unparent_fn()
551 T::UNPARENT.unwrap()(unsafe { state.as_ref() }); in rust_unparent_fn()
557 pub fn class_init<T: ObjectImpl>(&mut self) { in class_init()
558 if <T as ObjectImpl>::UNPARENT.is_some() { in class_init()
559 self.unparent = Some(rust_unparent_fn::<T>); in class_init()
599 pub struct Owned<T: ObjectType>(NonNull<T>);
608 unsafe impl<T: ObjectType + Send + Sync> Send for Owned<T> {}
616 unsafe impl<T: ObjectType + Sync + Send> Sync for Owned<T> {}
618 impl<T: ObjectType> Owned<T> {
637 pub unsafe fn from_raw(ptr: *const T) -> Self { in from_raw()
647 pub fn into_raw(src: Owned<T>) -> *mut T { in into_raw() argument
659 pub unsafe fn from(obj: &T) -> Self { in from()
671 impl<T: ObjectType> Clone for Owned<T> {
680 impl<T: ObjectType> Deref for Owned<T> {
681 type Target = T;
692 impl<T: ObjectType> ObjectDeref for Owned<T> {}
694 impl<T: ObjectType> Drop for Owned<T> {
706 impl<T: IsA<Object>> fmt::Debug for Owned<T> {
771 impl<T> ObjectClassMethods for T where T: IsA<Object> {} implementation