Skip to content

Commit dd6c70b

Browse files
committed
Update library
1 parent 6f72470 commit dd6c70b

File tree

5 files changed

+57
-16
lines changed

5 files changed

+57
-16
lines changed

Diff for: supercel/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ plugins {
1414
id("signing")
1515
}
1616

17-
version = "0.1.6"
17+
version = "0.1.7"
1818
android {
1919
namespace = "com.superwall.supercel"
2020
compileSdk = 34

Diff for: supercel/src/main/java/com/superwall/supercel/CEL.kt

+56-15
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ import kotlinx.coroutines.suspendCancellableCoroutine
4444
// A rust-owned buffer is represented by its capacity, its current length, and a
4545
// pointer to the underlying data.
4646

47+
/**
48+
* @suppress
49+
*/
4750
@Structure.FieldOrder("capacity", "len", "data")
4851
open class RustBuffer : Structure() {
4952
// Note: `capacity` and `len` are actually `ULong` values, but JVM only supports signed values.
@@ -96,6 +99,8 @@ open class RustBuffer : Structure() {
9699
* Required for callbacks taking in an out pointer.
97100
*
98101
* Size is the sum of all values in the struct.
102+
*
103+
* @suppress
99104
*/
100105
class RustBufferByReference : ByReference(16) {
101106
/**
@@ -130,16 +135,20 @@ class RustBufferByReference : ByReference(16) {
130135
// completeness.
131136

132137
@Structure.FieldOrder("len", "data")
133-
open class ForeignBytes : Structure() {
138+
internal open class ForeignBytes : Structure() {
134139
@JvmField var len: Int = 0
135140
@JvmField var data: Pointer? = null
136141

137142
class ByValue : ForeignBytes(), Structure.ByValue
138143
}
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+
*/
143152
public interface FfiConverter<KotlinType, FfiType> {
144153
// Convert an FFI type to a Kotlin type
145154
fun lift(value: FfiType): KotlinType
@@ -202,7 +211,11 @@ public interface FfiConverter<KotlinType, FfiType> {
202211
}
203212
}
204213

205-
// FfiConverter that uses `RustBuffer` as the FfiType
214+
/**
215+
* FfiConverter that uses `RustBuffer` as the FfiType
216+
*
217+
* @suppress
218+
*/
206219
public interface FfiConverterRustBuffer<KotlinType>: FfiConverter<KotlinType, RustBuffer.ByValue> {
207220
override fun lift(value: RustBuffer.ByValue) = liftFromRustBuffer(value)
208221
override fun lower(value: KotlinType) = lowerIntoRustBuffer(value)
@@ -245,7 +258,11 @@ internal open class UniffiRustCallStatus : Structure() {
245258

246259
class InternalException(message: String) : kotlin.Exception(message)
247260

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+
*/
249266
interface UniffiRustCallStatusErrorHandler<E> {
250267
fun lift(error_buf: RustBuffer.ByValue): E;
251268
}
@@ -282,7 +299,11 @@ private fun<E: kotlin.Exception> uniffiCheckCallStatus(errorHandler: UniffiRustC
282299
}
283300
}
284301

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+
*/
286307
object UniffiNullRustCallStatusErrorHandler: UniffiRustCallStatusErrorHandler<InternalException> {
287308
override fun lift(error_buf: RustBuffer.ByValue): InternalException {
288309
RustBuffer.free(error_buf)
@@ -1074,6 +1095,9 @@ interface Disposable {
10741095
}
10751096
}
10761097

1098+
/**
1099+
* @suppress
1100+
*/
10771101
inline fun <T : Disposable?, R> T.use(block: (T) -> R) =
10781102
try {
10791103
block(this)
@@ -1086,9 +1110,16 @@ inline fun <T : Disposable?, R> T.use(block: (T) -> R) =
10861110
}
10871111
}
10881112

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+
* */
10901118
object NoPointer
10911119

1120+
/**
1121+
* @suppress
1122+
*/
10921123
public object FfiConverterString: FfiConverter<String, RustBuffer.ByValue> {
10931124
// Note: we don't inherit from FfiConverterRustBuffer, because we use a
10941125
// special encoding when lowering/lifting. We can use `RustBuffer.len` to
@@ -1242,12 +1273,16 @@ public object FfiConverterString: FfiConverter<String, RustBuffer.ByValue> {
12421273
//
12431274

12441275

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+
*/
12511286
interface UniffiCleaner {
12521287
interface Cleanable {
12531288
fun clean()
@@ -1444,6 +1479,9 @@ internal const val UNIFFI_CALLBACK_SUCCESS = 0
14441479
internal const val UNIFFI_CALLBACK_ERROR = 1
14451480
internal const val UNIFFI_CALLBACK_UNEXPECTED_ERROR = 2
14461481

1482+
/**
1483+
* @suppress
1484+
*/
14471485
public abstract class FfiConverterCallbackInterface<CallbackInterface: Any>: FfiConverter<CallbackInterface, Long> {
14481486
internal val handleMap = UniffiHandleMap<CallbackInterface>()
14491487

@@ -1560,6 +1598,9 @@ internal object uniffiCallbackInterfaceHostContext {
15601598
}
15611599
}
15621600

1601+
/**
1602+
* @suppress
1603+
*/
15631604
public object FfiConverterTypeHostContext: FfiConverter<HostContext, Pointer> {
15641605
internal val handleMap = UniffiHandleMap<HostContext>()
15651606

Diff for: supercel/src/main/jniLibs/arm64-v8a/libuniffi_cel.so

0 Bytes
Binary file not shown.
192 Bytes
Binary file not shown.

Diff for: supercel/src/main/jniLibs/x86_64/libuniffi_cel.so

64 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)