1 // default #[pin_project], PinnedDrop, project_replace, !Unpin, and UnsafeUnpin without UnsafeUnpin impl are completely safe. 2 3 #[::pin_project::pin_project] 4 #[derive(Debug)] 5 pub struct DefaultStruct<T, U> { 6 #[pin] 7 pub pinned: T, 8 pub unpinned: U, 9 } 10 11 #[::pin_project::pin_project( 12 project = DefaultStructNamedProj, 13 project_ref = DefaultStructNamedProjRef, 14 )] 15 #[derive(Debug)] 16 pub struct DefaultStructNamed<T, U> { 17 #[pin] 18 pub pinned: T, 19 pub unpinned: U, 20 } 21 22 #[::pin_project::pin_project] 23 #[derive(Debug)] 24 pub struct DefaultTupleStruct<T, U>(#[pin] pub T, pub U); 25 26 #[::pin_project::pin_project( 27 project = DefaultTupleStructNamedProj, 28 project_ref = DefaultTupleStructNamedProjRef, 29 )] 30 #[derive(Debug)] 31 pub struct DefaultTupleStructNamed<T, U>(#[pin] pub T, pub U); 32 33 #[::pin_project::pin_project( 34 project = DefaultEnumProj, 35 project_ref = DefaultEnumProjRef, 36 )] 37 #[derive(Debug)] 38 pub enum DefaultEnum<T, U> { 39 Struct { 40 #[pin] 41 pinned: T, 42 unpinned: U, 43 }, 44 Tuple(#[pin] T, U), 45 Unit, 46 } 47 48 #[::pin_project::pin_project(PinnedDrop)] 49 #[derive(Debug)] 50 pub struct PinnedDropStruct<T, U> { 51 #[pin] 52 pub pinned: T, 53 pub unpinned: U, 54 } 55 56 #[::pin_project::pinned_drop] 57 impl<T, U> PinnedDrop for PinnedDropStruct<T, U> { drop(self: ::pin_project::__private::Pin<&mut Self>)58 fn drop(self: ::pin_project::__private::Pin<&mut Self>) {} 59 } 60 61 #[::pin_project::pin_project(PinnedDrop)] 62 #[derive(Debug)] 63 pub struct PinnedDropTupleStruct<T, U>(#[pin] pub T, pub U); 64 65 #[::pin_project::pinned_drop] 66 impl<T, U> PinnedDrop for PinnedDropTupleStruct<T, U> { drop(self: ::pin_project::__private::Pin<&mut Self>)67 fn drop(self: ::pin_project::__private::Pin<&mut Self>) {} 68 } 69 70 #[::pin_project::pin_project( 71 PinnedDrop, 72 project = PinnedDropEnumProj, 73 project_ref = PinnedDropEnumProjRef, 74 )] 75 #[derive(Debug)] 76 pub enum PinnedDropEnum<T, U> { 77 Struct { 78 #[pin] 79 pinned: T, 80 unpinned: U, 81 }, 82 Tuple(#[pin] T, U), 83 Unit, 84 } 85 86 #[::pin_project::pinned_drop] 87 impl<T, U> PinnedDrop for PinnedDropEnum<T, U> { drop(self: ::pin_project::__private::Pin<&mut Self>)88 fn drop(self: ::pin_project::__private::Pin<&mut Self>) {} 89 } 90 91 #[::pin_project::pin_project(project_replace)] 92 #[derive(Debug)] 93 pub struct ReplaceStruct<T, U> { 94 #[pin] 95 pub pinned: T, 96 pub unpinned: U, 97 } 98 99 #[::pin_project::pin_project( 100 project = ReplaceStructNamedProj, 101 project_ref = ReplaceStructNamedProjRef, 102 project_replace = ReplaceStructNamedProjOwn, 103 )] 104 #[derive(Debug)] 105 pub struct ReplaceStructNamed<T, U> { 106 #[pin] 107 pub pinned: T, 108 pub unpinned: U, 109 } 110 111 #[::pin_project::pin_project(project_replace)] 112 #[derive(Debug)] 113 pub struct ReplaceTupleStruct<T, U>(#[pin] pub T, pub U); 114 115 #[::pin_project::pin_project( 116 project = ReplaceTupleStructNamedProj, 117 project_ref = ReplaceTupleStructNamedProjRef, 118 project_replace = ReplaceTupleStructNamedProjOwn, 119 )] 120 #[derive(Debug)] 121 pub struct ReplaceTupleStructNamed<T, U>(#[pin] pub T, pub U); 122 123 #[::pin_project::pin_project( 124 project = ReplaceEnumProj, 125 project_ref = ReplaceEnumProjRef, 126 project_replace = ReplaceEnumProjOwn, 127 )] 128 #[derive(Debug)] 129 pub enum ReplaceEnum<T, U> { 130 Struct { 131 #[pin] 132 pinned: T, 133 unpinned: U, 134 }, 135 Tuple(#[pin] T, U), 136 Unit, 137 } 138 139 #[::pin_project::pin_project(UnsafeUnpin)] 140 #[derive(Debug)] 141 pub struct UnsafeUnpinStruct<T, U> { 142 #[pin] 143 pub pinned: T, 144 pub unpinned: U, 145 } 146 147 #[::pin_project::pin_project(UnsafeUnpin)] 148 #[derive(Debug)] 149 pub struct UnsafeUnpinTupleStruct<T, U>(#[pin] pub T, pub U); 150 151 #[::pin_project::pin_project( 152 UnsafeUnpin, 153 project = UnsafeUnpinEnumProj, 154 project_ref = UnsafeUnpinEnumProjRef, 155 )] 156 #[derive(Debug)] 157 pub enum UnsafeUnpinEnum<T, U> { 158 Struct { 159 #[pin] 160 pinned: T, 161 unpinned: U, 162 }, 163 Tuple(#[pin] T, U), 164 Unit, 165 } 166 167 #[::pin_project::pin_project(!Unpin)] 168 #[derive(Debug)] 169 pub struct NotUnpinStruct<T, U> { 170 #[pin] 171 pub pinned: T, 172 pub unpinned: U, 173 } 174 175 #[::pin_project::pin_project(!Unpin)] 176 #[derive(Debug)] 177 pub struct NotUnpinTupleStruct<T, U>(#[pin] pub T, pub U); 178 179 #[::pin_project::pin_project( 180 !Unpin, 181 project = NotUnpinEnumProj, 182 project_ref = NotUnpinEnumProjRef, 183 )] 184 #[derive(Debug)] 185 pub enum NotUnpinEnum<T, U> { 186 Struct { 187 #[pin] 188 pinned: T, 189 unpinned: U, 190 }, 191 Tuple(#[pin] T, U), 192 Unit, 193 } 194