@@ -44,6 +44,9 @@ import kotlinx.coroutines.suspendCancellableCoroutine
44
44
// A rust-owned buffer is represented by its capacity, its current length, and a
45
45
// pointer to the underlying data.
46
46
47
+ /* *
48
+ * @suppress
49
+ */
47
50
@Structure.FieldOrder (" capacity" , " len" , " data" )
48
51
open class RustBuffer : Structure () {
49
52
// Note: `capacity` and `len` are actually `ULong` values, but JVM only supports signed values.
@@ -96,6 +99,8 @@ open class RustBuffer : Structure() {
96
99
* Required for callbacks taking in an out pointer.
97
100
*
98
101
* Size is the sum of all values in the struct.
102
+ *
103
+ * @suppress
99
104
*/
100
105
class RustBufferByReference : ByReference (16 ) {
101
106
/* *
@@ -130,16 +135,20 @@ class RustBufferByReference : ByReference(16) {
130
135
// completeness.
131
136
132
137
@Structure.FieldOrder (" len" , " data" )
133
- open class ForeignBytes : Structure () {
138
+ internal open class ForeignBytes : Structure () {
134
139
@JvmField var len: Int = 0
135
140
@JvmField var data: Pointer ? = null
136
141
137
142
class ByValue : ForeignBytes (), Structure.ByValue
138
143
}
139
- // The FfiConverter interface handles converter types to and from the FFI
140
- //
141
- // All implementing objects should be public to support external types. When a
142
- // type is external we need to import it's FfiConverter.
144
+ /* *
145
+ * The FfiConverter interface handles converter types to and from the FFI
146
+ *
147
+ * All implementing objects should be public to support external types. When a
148
+ * type is external we need to import it's FfiConverter.
149
+ *
150
+ * @suppress
151
+ */
143
152
public interface FfiConverter <KotlinType , FfiType > {
144
153
// Convert an FFI type to a Kotlin type
145
154
fun lift (value : FfiType ): KotlinType
@@ -202,7 +211,11 @@ public interface FfiConverter<KotlinType, FfiType> {
202
211
}
203
212
}
204
213
205
- // FfiConverter that uses `RustBuffer` as the FfiType
214
+ /* *
215
+ * FfiConverter that uses `RustBuffer` as the FfiType
216
+ *
217
+ * @suppress
218
+ */
206
219
public interface FfiConverterRustBuffer <KotlinType >: FfiConverter <KotlinType , RustBuffer .ByValue > {
207
220
override fun lift (value : RustBuffer .ByValue ) = liftFromRustBuffer(value)
208
221
override fun lower (value : KotlinType ) = lowerIntoRustBuffer(value)
@@ -245,7 +258,11 @@ internal open class UniffiRustCallStatus : Structure() {
245
258
246
259
class InternalException (message : String ) : kotlin.Exception(message)
247
260
248
- // Each top-level error class has a companion object that can lift the error from the call status's rust buffer
261
+ /* *
262
+ * Each top-level error class has a companion object that can lift the error from the call status's rust buffer
263
+ *
264
+ * @suppress
265
+ */
249
266
interface UniffiRustCallStatusErrorHandler <E > {
250
267
fun lift (error_buf : RustBuffer .ByValue ): E ;
251
268
}
@@ -282,7 +299,11 @@ private fun<E: kotlin.Exception> uniffiCheckCallStatus(errorHandler: UniffiRustC
282
299
}
283
300
}
284
301
285
- // UniffiRustCallStatusErrorHandler implementation for times when we don't expect a CALL_ERROR
302
+ /* *
303
+ * UniffiRustCallStatusErrorHandler implementation for times when we don't expect a CALL_ERROR
304
+ *
305
+ * @suppress
306
+ */
286
307
object UniffiNullRustCallStatusErrorHandler: UniffiRustCallStatusErrorHandler<InternalException> {
287
308
override fun lift (error_buf : RustBuffer .ByValue ): InternalException {
288
309
RustBuffer .free(error_buf)
@@ -1074,6 +1095,9 @@ interface Disposable {
1074
1095
}
1075
1096
}
1076
1097
1098
+ /* *
1099
+ * @suppress
1100
+ */
1077
1101
inline fun <T : Disposable ?, R > T.use (block : (T ) -> R ) =
1078
1102
try {
1079
1103
block(this )
@@ -1086,9 +1110,16 @@ inline fun <T : Disposable?, R> T.use(block: (T) -> R) =
1086
1110
}
1087
1111
}
1088
1112
1089
- /* * Used to instantiate an interface without an actual pointer, for fakes in tests, mostly. */
1113
+ /* *
1114
+ * Used to instantiate an interface without an actual pointer, for fakes in tests, mostly.
1115
+ *
1116
+ * @suppress
1117
+ * */
1090
1118
object NoPointer
1091
1119
1120
+ /* *
1121
+ * @suppress
1122
+ */
1092
1123
public object FfiConverterString: FfiConverter<String, RustBuffer.ByValue> {
1093
1124
// Note: we don't inherit from FfiConverterRustBuffer, because we use a
1094
1125
// special encoding when lowering/lifting. We can use `RustBuffer.len` to
@@ -1242,12 +1273,16 @@ public object FfiConverterString: FfiConverter<String, RustBuffer.ByValue> {
1242
1273
//
1243
1274
1244
1275
1245
- // The cleaner interface for Object finalization code to run.
1246
- // This is the entry point to any implementation that we're using.
1247
- //
1248
- // The cleaner registers objects and returns cleanables, so now we are
1249
- // defining a `UniffiCleaner` with a `UniffiClenaer.Cleanable` to abstract the
1250
- // different implmentations available at compile time.
1276
+ /* *
1277
+ * The cleaner interface for Object finalization code to run.
1278
+ * This is the entry point to any implementation that we're using.
1279
+ *
1280
+ * The cleaner registers objects and returns cleanables, so now we are
1281
+ * defining a `UniffiCleaner` with a `UniffiClenaer.Cleanable` to abstract the
1282
+ * different implmentations available at compile time.
1283
+ *
1284
+ * @suppress
1285
+ */
1251
1286
interface UniffiCleaner {
1252
1287
interface Cleanable {
1253
1288
fun clean ()
@@ -1444,6 +1479,9 @@ internal const val UNIFFI_CALLBACK_SUCCESS = 0
1444
1479
internal const val UNIFFI_CALLBACK_ERROR = 1
1445
1480
internal const val UNIFFI_CALLBACK_UNEXPECTED_ERROR = 2
1446
1481
1482
+ /* *
1483
+ * @suppress
1484
+ */
1447
1485
public abstract class FfiConverterCallbackInterface <CallbackInterface : Any >: FfiConverter <CallbackInterface , Long > {
1448
1486
internal val handleMap = UniffiHandleMap <CallbackInterface >()
1449
1487
@@ -1560,6 +1598,9 @@ internal object uniffiCallbackInterfaceHostContext {
1560
1598
}
1561
1599
}
1562
1600
1601
+ /* *
1602
+ * @suppress
1603
+ */
1563
1604
public object FfiConverterTypeHostContext: FfiConverter<HostContext, Pointer> {
1564
1605
internal val handleMap = UniffiHandleMap <HostContext >()
1565
1606
0 commit comments