File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -8,11 +8,20 @@ use crate::translate::*;
8
8
/// A list of items of type `T`.
9
9
///
10
10
/// Behaves like an `Iterator<Item = T>` but allows modifications.
11
+ #[ repr( transparent) ]
11
12
pub struct List < T : TransparentPtrType > {
12
13
ptr : Option < ptr:: NonNull < ffi:: GList > > ,
13
14
phantom : PhantomData < T > ,
14
15
}
15
16
17
+ #[ doc( hidden) ]
18
+ unsafe impl < T : TransparentPtrType > TransparentPtrType for List < T > { }
19
+
20
+ #[ doc( hidden) ]
21
+ impl < T : TransparentPtrType > GlibPtrDefault for List < T > {
22
+ type GlibType = * mut ffi:: GList ;
23
+ }
24
+
16
25
unsafe impl < T : Send + TransparentPtrType > Send for List < T > { }
17
26
18
27
unsafe impl < T : Sync + TransparentPtrType > Sync for List < T > { }
Original file line number Diff line number Diff line change @@ -8,11 +8,20 @@ use crate::translate::*;
8
8
/// A list of items of type `T`.
9
9
///
10
10
/// Behaves like an `Iterator<Item = T>` but allows modifications.
11
+ #[ repr( transparent) ]
11
12
pub struct SList < T : TransparentPtrType > {
12
13
ptr : Option < ptr:: NonNull < ffi:: GSList > > ,
13
14
phantom : PhantomData < T > ,
14
15
}
15
16
17
+ #[ doc( hidden) ]
18
+ unsafe impl < T : TransparentPtrType > TransparentPtrType for SList < T > { }
19
+
20
+ #[ doc( hidden) ]
21
+ impl < T : TransparentPtrType > GlibPtrDefault for SList < T > {
22
+ type GlibType = * mut ffi:: GSList ;
23
+ }
24
+
16
25
unsafe impl < T : Send + TransparentPtrType > Send for SList < T > { }
17
26
18
27
unsafe impl < T : Sync + TransparentPtrType > Sync for SList < T > { }
You can’t perform that action at this time.
0 commit comments