diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ee8e8fc3c..904478581 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,6 +44,8 @@ jobs: echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules sudo udevadm control --reload-rules sudo udevadm trigger --name-match=kvm + - name: Explicitly install openssl + run: sudo apt-get install -y pkg-config libssl-dev - name: Setup Gradle uses: gradle/actions/setup-gradle@v3 - name: Start Docker containers diff --git a/build.gradle b/build.gradle index 861d2b9f7..3a6e8fef2 100644 --- a/build.gradle +++ b/build.gradle @@ -9,8 +9,8 @@ //} plugins { - id 'com.android.application' version '8.0.0' apply false - id 'com.android.library' version '8.0.0' apply false + id 'com.android.application' version '8.2.2' apply false + id 'com.android.library' version '8.2.2' apply false id 'org.jetbrains.kotlin.android' version '1.8.0' apply false id 'io.github.gradle-nexus.publish-plugin' version "1.2.0" id "org.jetbrains.dokka" version "1.8.10" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 474c74efe..e2a4de9b0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Tue Dec 20 09:09:47 PST 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/library/src/main/java/README.md b/library/src/main/java/README.md index 6020e2fa5..df70f10ad 100644 --- a/library/src/main/java/README.md +++ b/library/src/main/java/README.md @@ -5,12 +5,12 @@ Kotlin code emitted by the `bindings_ffi` crate in [libxmtp](https://github.com/ ## Process for updating from a [libxmtp](https://github.com/xmtp/libxmtp) Kotlin Binding Release 1. From repo [libxmtp](https://github.com/xmtp/libxmtp) run the [kotlin release action](https://github.com/xmtp/libxmtp/actions/workflows/release-kotlin-bindings.yml) for the branch you desire -2. Create a new branch in the `xmtp-android` repo +2. Create a new branch in the `xmtp-android` repo. With `libxmtp` repo and `xmtp-android` (this repo) cloned locally in sibling directories, and `libxmtp` checked out to the correct release commit, run the script: - `./bindings_ffi/gen_kotlin.sh` + `cd bindings_ffi/ && ./gen_kotlin.sh` 3. Run format (cmd + opt + l) function to keep the code format consistent and diff small for `xmtp-android/library/src/main/java/xmtpv3.kt` 4. Navigate to the [latest release](https://github.com/xmtp/libxmtp/releases) once the action completes 5. Download the `LibXMTPKotlinFFI.zip` assets 6. Unzip and then copy the jniLibs to `xmtp-android/library/src/main/jniLibs` -You should now be on the latest libxmtp. Tests will fail if the jniLibs do not match the version of xmtpv3. \ No newline at end of file +You should now be on the latest libxmtp. Tests will fail if the jniLibs do not match the version of xmtpv3. diff --git a/library/src/main/java/libxmtp-version.txt b/library/src/main/java/libxmtp-version.txt index f2d59ae54..1422536b4 100644 --- a/library/src/main/java/libxmtp-version.txt +++ b/library/src/main/java/libxmtp-version.txt @@ -1,3 +1,3 @@ -Version: 4a572e8a -Branch: main -Date: 2024-07-23 15:16:12 +0000 +Version: 5641e261 +Branch: st/fix-openssl-binding +Date: 2024-07-24 20:22:11 +0000 diff --git a/library/src/main/java/xmtpv3.kt b/library/src/main/java/xmtpv3.kt index 63445eb5c..9b9a2742b 100644 --- a/library/src/main/java/xmtpv3.kt +++ b/library/src/main/java/xmtpv3.kt @@ -3,7 +3,7 @@ @file:Suppress("NAME_SHADOWING") -package uniffi.xmtpv3; +package uniffi.xmtpv3 // Common helper code. // @@ -17,27 +17,22 @@ package uniffi.xmtpv3; // compile the Rust component. The easiest way to ensure this is to bundle the Kotlin // helpers directly inline like we're doing here. +import com.sun.jna.Callback import com.sun.jna.Library -import com.sun.jna.IntegerType import com.sun.jna.Native import com.sun.jna.Pointer import com.sun.jna.Structure -import com.sun.jna.Callback import com.sun.jna.ptr.* +import kotlinx.coroutines.CancellableContinuation +import kotlinx.coroutines.suspendCancellableCoroutine import java.nio.ByteBuffer import java.nio.ByteOrder import java.nio.CharBuffer import java.nio.charset.CodingErrorAction -import java.util.concurrent.atomic.AtomicLong import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.atomic.AtomicBoolean +import java.util.concurrent.atomic.AtomicLong import kotlin.coroutines.resume -import kotlinx.coroutines.CancellableContinuation -import kotlinx.coroutines.DelicateCoroutinesApi -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.Job -import kotlinx.coroutines.launch -import kotlinx.coroutines.suspendCancellableCoroutine // This is a helper for safely working with byte buffers returned from the Rust code. // A rust-owned buffer is represented by its capacity, its current length, and a @@ -47,15 +42,19 @@ import kotlinx.coroutines.suspendCancellableCoroutine open class RustBuffer : Structure() { // Note: `capacity` and `len` are actually `ULong` values, but JVM only supports signed values. // When dealing with these fields, make sure to call `toULong()`. - @JvmField - var capacity: Long = 0 - @JvmField - var len: Long = 0 - @JvmField - var data: Pointer? = null + @JvmField var capacity: Long = 0 - class ByValue : RustBuffer(), Structure.ByValue - class ByReference : RustBuffer(), Structure.ByReference + @JvmField var len: Long = 0 + + @JvmField var data: Pointer? = null + + class ByValue : + RustBuffer(), + Structure.ByValue + + class ByReference : + RustBuffer(), + Structure.ByReference internal fun setValue(other: RustBuffer) { capacity = other.capacity @@ -64,16 +63,21 @@ open class RustBuffer : Structure() { } companion object { - internal fun alloc(size: ULong = 0UL) = uniffiRustCall() { status -> - // Note: need to convert the size to a `Long` value to make this work with JVM. - UniffiLib.INSTANCE.ffi_xmtpv3_rustbuffer_alloc(size.toLong(), status) - }.also { - if (it.data == null) { - throw RuntimeException("RustBuffer.alloc() returned null data pointer (size=${size})") + internal fun alloc(size: ULong = 0UL) = + uniffiRustCall { status -> + // Note: need to convert the size to a `Long` value to make this work with JVM. + UniffiLib.INSTANCE.ffi_xmtpv3_rustbuffer_alloc(size.toLong(), status) + }.also { + if (it.data == null) { + throw RuntimeException("RustBuffer.alloc() returned null data pointer (size=$size)") + } } - } - internal fun create(capacity: ULong, len: ULong, data: Pointer?): RustBuffer.ByValue { + internal fun create( + capacity: ULong, + len: ULong, + data: Pointer?, + ): RustBuffer.ByValue { var buf = RustBuffer.ByValue() buf.capacity = capacity.toLong() buf.len = len.toLong() @@ -81,9 +85,10 @@ open class RustBuffer : Structure() { return buf } - internal fun free(buf: RustBuffer.ByValue) = uniffiRustCall() { status -> - UniffiLib.INSTANCE.ffi_xmtpv3_rustbuffer_free(buf, status) - } + internal fun free(buf: RustBuffer.ByValue) = + uniffiRustCall { status -> + UniffiLib.INSTANCE.ffi_xmtpv3_rustbuffer_free(buf, status) + } } @Suppress("TooGenericExceptionThrown") @@ -133,12 +138,13 @@ class RustBufferByReference : ByReference(16) { @Structure.FieldOrder("len", "data") open class ForeignBytes : Structure() { - @JvmField - var len: Int = 0 - @JvmField - var data: Pointer? = null + @JvmField var len: Int = 0 - class ByValue : ForeignBytes(), Structure.ByValue + @JvmField var data: Pointer? = null + + class ByValue : + ForeignBytes(), + Structure.ByValue } // The FfiConverter interface handles converter types to and from the FFI @@ -166,7 +172,10 @@ public interface FfiConverter { fun allocationSize(value: KotlinType): ULong // Write a Kotlin type to a `ByteBuffer` - fun write(value: KotlinType, buf: ByteBuffer) + fun write( + value: KotlinType, + buf: ByteBuffer, + ) // Lower a value into a `RustBuffer` // @@ -177,9 +186,10 @@ public interface FfiConverter { fun lowerIntoRustBuffer(value: KotlinType): RustBuffer.ByValue { val rbuf = RustBuffer.alloc(allocationSize(value)) try { - val bbuf = rbuf.data!!.getByteBuffer(0, rbuf.capacity).also { - it.order(ByteOrder.BIG_ENDIAN) - } + val bbuf = + rbuf.data!!.getByteBuffer(0, rbuf.capacity).also { + it.order(ByteOrder.BIG_ENDIAN) + } write(value, bbuf) rbuf.writeField("len", bbuf.position().toLong()) return rbuf @@ -210,6 +220,7 @@ public interface FfiConverter { // FfiConverter that uses `RustBuffer` as the FfiType public interface FfiConverterRustBuffer : FfiConverter { override fun lift(value: RustBuffer.ByValue) = liftFromRustBuffer(value) + override fun lower(value: KotlinType) = lowerIntoRustBuffer(value) } // A handful of classes and functions to support the generated data structures. @@ -221,27 +232,25 @@ internal const val UNIFFI_CALL_UNEXPECTED_ERROR = 2.toByte() @Structure.FieldOrder("code", "error_buf") internal open class UniffiRustCallStatus : Structure() { - @JvmField - var code: Byte = 0 - @JvmField - var error_buf: RustBuffer.ByValue = RustBuffer.ByValue() + @JvmField var code: Byte = 0 - class ByValue : UniffiRustCallStatus(), Structure.ByValue + @JvmField var error_buf: RustBuffer.ByValue = RustBuffer.ByValue() - fun isSuccess(): Boolean { - return code == UNIFFI_CALL_SUCCESS - } + class ByValue : + UniffiRustCallStatus(), + Structure.ByValue - fun isError(): Boolean { - return code == UNIFFI_CALL_ERROR - } + fun isSuccess(): Boolean = code == UNIFFI_CALL_SUCCESS - fun isPanic(): Boolean { - return code == UNIFFI_CALL_UNEXPECTED_ERROR - } + fun isError(): Boolean = code == UNIFFI_CALL_ERROR + + fun isPanic(): Boolean = code == UNIFFI_CALL_UNEXPECTED_ERROR companion object { - fun create(code: Byte, errorBuf: RustBuffer.ByValue): UniffiRustCallStatus.ByValue { + fun create( + code: Byte, + errorBuf: RustBuffer.ByValue, + ): UniffiRustCallStatus.ByValue { val callStatus = UniffiRustCallStatus.ByValue() callStatus.code = code callStatus.error_buf = errorBuf @@ -250,11 +259,13 @@ internal open class UniffiRustCallStatus : Structure() { } } -class InternalException(message: String) : Exception(message) +class InternalException( + message: String, +) : Exception(message) // Each top-level error class has a companion object that can lift the error from the call status's rust buffer interface UniffiRustCallStatusErrorHandler { - fun lift(error_buf: RustBuffer.ByValue): E; + fun lift(error_buf: RustBuffer.ByValue): E } // Helpers for calling Rust @@ -264,9 +275,9 @@ interface UniffiRustCallStatusErrorHandler { // Call a rust function that returns a Result<>. Pass in the Error class companion that corresponds to the Err private inline fun uniffiRustCallWithError( errorHandler: UniffiRustCallStatusErrorHandler, - callback: (UniffiRustCallStatus) -> U + callback: (UniffiRustCallStatus) -> U, ): U { - var status = UniffiRustCallStatus(); + var status = UniffiRustCallStatus() val return_value = callback(status) uniffiCheckCallStatus(errorHandler, status) return return_value @@ -275,7 +286,7 @@ private inline fun uniffiRustCallWithError( // Check UniffiRustCallStatus and throw an error if the call wasn't successful private fun uniffiCheckCallStatus( errorHandler: UniffiRustCallStatusErrorHandler, - status: UniffiRustCallStatus + status: UniffiRustCallStatus, ) { if (status.isSuccess()) { return @@ -304,9 +315,8 @@ object UniffiNullRustCallStatusErrorHandler : UniffiRustCallStatusErrorHandler uniffiRustCall(callback: (UniffiRustCallStatus) -> U): U { - return uniffiRustCallWithError(UniffiNullRustCallStatusErrorHandler, callback); -} +private inline fun uniffiRustCall(callback: (UniffiRustCallStatus) -> U): U = + uniffiRustCallWithError(UniffiNullRustCallStatusErrorHandler, callback) internal inline fun uniffiTraitInterfaceCall( callStatus: UniffiRustCallStatus, @@ -325,7 +335,7 @@ internal inline fun uniffiTraitInterfaceCallWithError callStatus: UniffiRustCallStatus, makeCall: () -> T, writeReturn: (T) -> Unit, - lowerError: (E) -> RustBuffer.ByValue + lowerError: (E) -> RustBuffer.ByValue, ) { try { writeReturn(makeCall()) @@ -345,7 +355,9 @@ internal inline fun uniffiTraitInterfaceCallWithError // This is used pass an opaque 64-bit handle representing a foreign object to the Rust code. internal class UniffiHandleMap { private val map = ConcurrentHashMap() - private val counter = java.util.concurrent.atomic.AtomicLong(0) + private val counter = + java.util.concurrent.atomic + .AtomicLong(0) val size: Int get() = map.size @@ -358,14 +370,10 @@ internal class UniffiHandleMap { } // Get an object from the handle map - fun get(handle: Long): T { - return map.get(handle) ?: throw InternalException("UniffiHandleMap.get: Invalid handle") - } + fun get(handle: Long): T = map.get(handle) ?: throw InternalException("UniffiHandleMap.get: Invalid handle") // Remove an entry from the handlemap and get the Kotlin object back - fun remove(handle: Long): T { - return map.remove(handle) ?: throw InternalException("UniffiHandleMap: Invalid handle") - } + fun remove(handle: Long): T = map.remove(handle) ?: throw InternalException("UniffiHandleMap: Invalid handle") } // Contains loading, initialization code, @@ -379,15 +387,15 @@ private fun findLibraryName(componentName: String): String { return "uniffi_xmtpv3" } -private inline fun loadIndirect( - componentName: String -): Lib { - return Native.load(findLibraryName(componentName), Lib::class.java) -} +private inline fun loadIndirect(componentName: String): Lib = + Native.load(findLibraryName(componentName), Lib::class.java) // Define FFI callback types internal interface UniffiRustFutureContinuationCallback : com.sun.jna.Callback { - fun callback(`data`: Long, `pollResult`: Byte) + fun callback( + `data`: Long, + `pollResult`: Byte, + ) } internal interface UniffiForeignFutureFree : com.sun.jna.Callback { @@ -406,13 +414,13 @@ internal open class UniffiForeignFuture( class UniffiByValue( `handle`: Long = 0.toLong(), `free`: UniffiForeignFutureFree? = null, - ) : UniffiForeignFuture(`handle`, `free`), Structure.ByValue + ) : UniffiForeignFuture(`handle`, `free`), + Structure.ByValue internal fun uniffiSetValue(other: UniffiForeignFuture) { `handle` = other.`handle` `free` = other.`free` } - } @Structure.FieldOrder("returnValue", "callStatus") @@ -423,17 +431,20 @@ internal open class UniffiForeignFutureStructU8( class UniffiByValue( `returnValue`: Byte = 0.toByte(), `callStatus`: UniffiRustCallStatus.ByValue = UniffiRustCallStatus.ByValue(), - ) : UniffiForeignFutureStructU8(`returnValue`, `callStatus`), Structure.ByValue + ) : UniffiForeignFutureStructU8(`returnValue`, `callStatus`), + Structure.ByValue internal fun uniffiSetValue(other: UniffiForeignFutureStructU8) { `returnValue` = other.`returnValue` `callStatus` = other.`callStatus` } - } internal interface UniffiForeignFutureCompleteU8 : com.sun.jna.Callback { - fun callback(`callbackData`: Long, `result`: UniffiForeignFutureStructU8.UniffiByValue) + fun callback( + `callbackData`: Long, + `result`: UniffiForeignFutureStructU8.UniffiByValue, + ) } @Structure.FieldOrder("returnValue", "callStatus") @@ -444,17 +455,20 @@ internal open class UniffiForeignFutureStructI8( class UniffiByValue( `returnValue`: Byte = 0.toByte(), `callStatus`: UniffiRustCallStatus.ByValue = UniffiRustCallStatus.ByValue(), - ) : UniffiForeignFutureStructI8(`returnValue`, `callStatus`), Structure.ByValue + ) : UniffiForeignFutureStructI8(`returnValue`, `callStatus`), + Structure.ByValue internal fun uniffiSetValue(other: UniffiForeignFutureStructI8) { `returnValue` = other.`returnValue` `callStatus` = other.`callStatus` } - } internal interface UniffiForeignFutureCompleteI8 : com.sun.jna.Callback { - fun callback(`callbackData`: Long, `result`: UniffiForeignFutureStructI8.UniffiByValue) + fun callback( + `callbackData`: Long, + `result`: UniffiForeignFutureStructI8.UniffiByValue, + ) } @Structure.FieldOrder("returnValue", "callStatus") @@ -465,17 +479,20 @@ internal open class UniffiForeignFutureStructU16( class UniffiByValue( `returnValue`: Short = 0.toShort(), `callStatus`: UniffiRustCallStatus.ByValue = UniffiRustCallStatus.ByValue(), - ) : UniffiForeignFutureStructU16(`returnValue`, `callStatus`), Structure.ByValue + ) : UniffiForeignFutureStructU16(`returnValue`, `callStatus`), + Structure.ByValue internal fun uniffiSetValue(other: UniffiForeignFutureStructU16) { `returnValue` = other.`returnValue` `callStatus` = other.`callStatus` } - } internal interface UniffiForeignFutureCompleteU16 : com.sun.jna.Callback { - fun callback(`callbackData`: Long, `result`: UniffiForeignFutureStructU16.UniffiByValue) + fun callback( + `callbackData`: Long, + `result`: UniffiForeignFutureStructU16.UniffiByValue, + ) } @Structure.FieldOrder("returnValue", "callStatus") @@ -486,17 +503,20 @@ internal open class UniffiForeignFutureStructI16( class UniffiByValue( `returnValue`: Short = 0.toShort(), `callStatus`: UniffiRustCallStatus.ByValue = UniffiRustCallStatus.ByValue(), - ) : UniffiForeignFutureStructI16(`returnValue`, `callStatus`), Structure.ByValue + ) : UniffiForeignFutureStructI16(`returnValue`, `callStatus`), + Structure.ByValue internal fun uniffiSetValue(other: UniffiForeignFutureStructI16) { `returnValue` = other.`returnValue` `callStatus` = other.`callStatus` } - } internal interface UniffiForeignFutureCompleteI16 : com.sun.jna.Callback { - fun callback(`callbackData`: Long, `result`: UniffiForeignFutureStructI16.UniffiByValue) + fun callback( + `callbackData`: Long, + `result`: UniffiForeignFutureStructI16.UniffiByValue, + ) } @Structure.FieldOrder("returnValue", "callStatus") @@ -507,17 +527,20 @@ internal open class UniffiForeignFutureStructU32( class UniffiByValue( `returnValue`: Int = 0, `callStatus`: UniffiRustCallStatus.ByValue = UniffiRustCallStatus.ByValue(), - ) : UniffiForeignFutureStructU32(`returnValue`, `callStatus`), Structure.ByValue + ) : UniffiForeignFutureStructU32(`returnValue`, `callStatus`), + Structure.ByValue internal fun uniffiSetValue(other: UniffiForeignFutureStructU32) { `returnValue` = other.`returnValue` `callStatus` = other.`callStatus` } - } internal interface UniffiForeignFutureCompleteU32 : com.sun.jna.Callback { - fun callback(`callbackData`: Long, `result`: UniffiForeignFutureStructU32.UniffiByValue) + fun callback( + `callbackData`: Long, + `result`: UniffiForeignFutureStructU32.UniffiByValue, + ) } @Structure.FieldOrder("returnValue", "callStatus") @@ -528,17 +551,20 @@ internal open class UniffiForeignFutureStructI32( class UniffiByValue( `returnValue`: Int = 0, `callStatus`: UniffiRustCallStatus.ByValue = UniffiRustCallStatus.ByValue(), - ) : UniffiForeignFutureStructI32(`returnValue`, `callStatus`), Structure.ByValue + ) : UniffiForeignFutureStructI32(`returnValue`, `callStatus`), + Structure.ByValue internal fun uniffiSetValue(other: UniffiForeignFutureStructI32) { `returnValue` = other.`returnValue` `callStatus` = other.`callStatus` } - } internal interface UniffiForeignFutureCompleteI32 : com.sun.jna.Callback { - fun callback(`callbackData`: Long, `result`: UniffiForeignFutureStructI32.UniffiByValue) + fun callback( + `callbackData`: Long, + `result`: UniffiForeignFutureStructI32.UniffiByValue, + ) } @Structure.FieldOrder("returnValue", "callStatus") @@ -549,17 +575,20 @@ internal open class UniffiForeignFutureStructU64( class UniffiByValue( `returnValue`: Long = 0.toLong(), `callStatus`: UniffiRustCallStatus.ByValue = UniffiRustCallStatus.ByValue(), - ) : UniffiForeignFutureStructU64(`returnValue`, `callStatus`), Structure.ByValue + ) : UniffiForeignFutureStructU64(`returnValue`, `callStatus`), + Structure.ByValue internal fun uniffiSetValue(other: UniffiForeignFutureStructU64) { `returnValue` = other.`returnValue` `callStatus` = other.`callStatus` } - } internal interface UniffiForeignFutureCompleteU64 : com.sun.jna.Callback { - fun callback(`callbackData`: Long, `result`: UniffiForeignFutureStructU64.UniffiByValue) + fun callback( + `callbackData`: Long, + `result`: UniffiForeignFutureStructU64.UniffiByValue, + ) } @Structure.FieldOrder("returnValue", "callStatus") @@ -570,17 +599,20 @@ internal open class UniffiForeignFutureStructI64( class UniffiByValue( `returnValue`: Long = 0.toLong(), `callStatus`: UniffiRustCallStatus.ByValue = UniffiRustCallStatus.ByValue(), - ) : UniffiForeignFutureStructI64(`returnValue`, `callStatus`), Structure.ByValue + ) : UniffiForeignFutureStructI64(`returnValue`, `callStatus`), + Structure.ByValue internal fun uniffiSetValue(other: UniffiForeignFutureStructI64) { `returnValue` = other.`returnValue` `callStatus` = other.`callStatus` } - } internal interface UniffiForeignFutureCompleteI64 : com.sun.jna.Callback { - fun callback(`callbackData`: Long, `result`: UniffiForeignFutureStructI64.UniffiByValue) + fun callback( + `callbackData`: Long, + `result`: UniffiForeignFutureStructI64.UniffiByValue, + ) } @Structure.FieldOrder("returnValue", "callStatus") @@ -591,17 +623,20 @@ internal open class UniffiForeignFutureStructF32( class UniffiByValue( `returnValue`: Float = 0.0f, `callStatus`: UniffiRustCallStatus.ByValue = UniffiRustCallStatus.ByValue(), - ) : UniffiForeignFutureStructF32(`returnValue`, `callStatus`), Structure.ByValue + ) : UniffiForeignFutureStructF32(`returnValue`, `callStatus`), + Structure.ByValue internal fun uniffiSetValue(other: UniffiForeignFutureStructF32) { `returnValue` = other.`returnValue` `callStatus` = other.`callStatus` } - } internal interface UniffiForeignFutureCompleteF32 : com.sun.jna.Callback { - fun callback(`callbackData`: Long, `result`: UniffiForeignFutureStructF32.UniffiByValue) + fun callback( + `callbackData`: Long, + `result`: UniffiForeignFutureStructF32.UniffiByValue, + ) } @Structure.FieldOrder("returnValue", "callStatus") @@ -612,17 +647,20 @@ internal open class UniffiForeignFutureStructF64( class UniffiByValue( `returnValue`: Double = 0.0, `callStatus`: UniffiRustCallStatus.ByValue = UniffiRustCallStatus.ByValue(), - ) : UniffiForeignFutureStructF64(`returnValue`, `callStatus`), Structure.ByValue + ) : UniffiForeignFutureStructF64(`returnValue`, `callStatus`), + Structure.ByValue internal fun uniffiSetValue(other: UniffiForeignFutureStructF64) { `returnValue` = other.`returnValue` `callStatus` = other.`callStatus` } - } internal interface UniffiForeignFutureCompleteF64 : com.sun.jna.Callback { - fun callback(`callbackData`: Long, `result`: UniffiForeignFutureStructF64.UniffiByValue) + fun callback( + `callbackData`: Long, + `result`: UniffiForeignFutureStructF64.UniffiByValue, + ) } @Structure.FieldOrder("returnValue", "callStatus") @@ -633,17 +671,20 @@ internal open class UniffiForeignFutureStructPointer( class UniffiByValue( `returnValue`: Pointer = Pointer.NULL, `callStatus`: UniffiRustCallStatus.ByValue = UniffiRustCallStatus.ByValue(), - ) : UniffiForeignFutureStructPointer(`returnValue`, `callStatus`), Structure.ByValue + ) : UniffiForeignFutureStructPointer(`returnValue`, `callStatus`), + Structure.ByValue internal fun uniffiSetValue(other: UniffiForeignFutureStructPointer) { `returnValue` = other.`returnValue` `callStatus` = other.`callStatus` } - } internal interface UniffiForeignFutureCompletePointer : com.sun.jna.Callback { - fun callback(`callbackData`: Long, `result`: UniffiForeignFutureStructPointer.UniffiByValue) + fun callback( + `callbackData`: Long, + `result`: UniffiForeignFutureStructPointer.UniffiByValue, + ) } @Structure.FieldOrder("returnValue", "callStatus") @@ -654,13 +695,13 @@ internal open class UniffiForeignFutureStructRustBuffer( class UniffiByValue( `returnValue`: RustBuffer.ByValue = RustBuffer.ByValue(), `callStatus`: UniffiRustCallStatus.ByValue = UniffiRustCallStatus.ByValue(), - ) : UniffiForeignFutureStructRustBuffer(`returnValue`, `callStatus`), Structure.ByValue + ) : UniffiForeignFutureStructRustBuffer(`returnValue`, `callStatus`), + Structure.ByValue internal fun uniffiSetValue(other: UniffiForeignFutureStructRustBuffer) { `returnValue` = other.`returnValue` `callStatus` = other.`callStatus` } - } internal interface UniffiForeignFutureCompleteRustBuffer : com.sun.jna.Callback { @@ -676,16 +717,19 @@ internal open class UniffiForeignFutureStructVoid( ) : Structure() { class UniffiByValue( `callStatus`: UniffiRustCallStatus.ByValue = UniffiRustCallStatus.ByValue(), - ) : UniffiForeignFutureStructVoid(`callStatus`), Structure.ByValue + ) : UniffiForeignFutureStructVoid(`callStatus`), + Structure.ByValue internal fun uniffiSetValue(other: UniffiForeignFutureStructVoid) { `callStatus` = other.`callStatus` } - } internal interface UniffiForeignFutureCompleteVoid : com.sun.jna.Callback { - fun callback(`callbackData`: Long, `result`: UniffiForeignFutureStructVoid.UniffiByValue) + fun callback( + `callbackData`: Long, + `result`: UniffiForeignFutureStructVoid.UniffiByValue, + ) } internal interface UniffiCallbackInterfaceFfiInboxOwnerMethod0 : com.sun.jna.Callback { @@ -761,7 +805,6 @@ internal open class UniffiVTableCallbackInterfaceFfiInboxOwner( `sign` = other.`sign` `uniffiFree` = other.`uniffiFree` } - } @Structure.FieldOrder("log", "uniffiFree") @@ -772,13 +815,13 @@ internal open class UniffiVTableCallbackInterfaceFfiLogger( class UniffiByValue( `log`: UniffiCallbackInterfaceFfiLoggerMethod0? = null, `uniffiFree`: UniffiCallbackInterfaceFree? = null, - ) : UniffiVTableCallbackInterfaceFfiLogger(`log`, `uniffiFree`), Structure.ByValue + ) : UniffiVTableCallbackInterfaceFfiLogger(`log`, `uniffiFree`), + Structure.ByValue internal fun uniffiSetValue(other: UniffiVTableCallbackInterfaceFfiLogger) { `log` = other.`log` `uniffiFree` = other.`uniffiFree` } - } @Structure.FieldOrder("onConversation", "uniffiFree") @@ -796,7 +839,6 @@ internal open class UniffiVTableCallbackInterfaceFfiConversationCallback( `onConversation` = other.`onConversation` `uniffiFree` = other.`uniffiFree` } - } @Structure.FieldOrder("onMessage", "uniffiFree") @@ -814,7 +856,6 @@ internal open class UniffiVTableCallbackInterfaceFfiMessageCallback( `onMessage` = other.`onMessage` `uniffiFree` = other.`uniffiFree` } - } @Structure.FieldOrder("onMessage", "uniffiFree") @@ -832,10 +873,8 @@ internal open class UniffiVTableCallbackInterfaceFfiV2SubscriptionCallback( `onMessage` = other.`onMessage` `uniffiFree` = other.`uniffiFree` } - } - // A JNA Library to expose the extern-C FFI definitions. // This is an implementation detail which will be called internally by the public API. @@ -861,179 +900,219 @@ internal interface UniffiLib : Library { } fun uniffi_xmtpv3_fn_clone_fficonversations( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_xmtpv3_fn_free_fficonversations( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_xmtpv3_fn_method_fficonversations_create_group( - `ptr`: Pointer, `accountAddresses`: RustBuffer.ByValue, `opts`: RustBuffer.ByValue, + `ptr`: Pointer, + `accountAddresses`: RustBuffer.ByValue, + `opts`: RustBuffer.ByValue, ): Long fun uniffi_xmtpv3_fn_method_fficonversations_list( - `ptr`: Pointer, `opts`: RustBuffer.ByValue, + `ptr`: Pointer, + `opts`: RustBuffer.ByValue, ): Long fun uniffi_xmtpv3_fn_method_fficonversations_process_streamed_welcome_message( - `ptr`: Pointer, `envelopeBytes`: RustBuffer.ByValue, + `ptr`: Pointer, + `envelopeBytes`: RustBuffer.ByValue, ): Long fun uniffi_xmtpv3_fn_method_fficonversations_stream( - `ptr`: Pointer, `callback`: Long, + `ptr`: Pointer, + `callback`: Long, ): Long fun uniffi_xmtpv3_fn_method_fficonversations_stream_all_messages( - `ptr`: Pointer, `messageCallback`: Long, - ): Long - - fun uniffi_xmtpv3_fn_method_fficonversations_sync( `ptr`: Pointer, + `messageCallback`: Long, ): Long + fun uniffi_xmtpv3_fn_method_fficonversations_sync(`ptr`: Pointer): Long + fun uniffi_xmtpv3_fn_clone_ffigroup( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_xmtpv3_fn_free_ffigroup( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_xmtpv3_fn_method_ffigroup_add_admin( - `ptr`: Pointer, `inboxId`: RustBuffer.ByValue, + `ptr`: Pointer, + `inboxId`: RustBuffer.ByValue, ): Long fun uniffi_xmtpv3_fn_method_ffigroup_add_members( - `ptr`: Pointer, `accountAddresses`: RustBuffer.ByValue, + `ptr`: Pointer, + `accountAddresses`: RustBuffer.ByValue, ): Long fun uniffi_xmtpv3_fn_method_ffigroup_add_members_by_inbox_id( - `ptr`: Pointer, `inboxIds`: RustBuffer.ByValue, + `ptr`: Pointer, + `inboxIds`: RustBuffer.ByValue, ): Long fun uniffi_xmtpv3_fn_method_ffigroup_add_super_admin( - `ptr`: Pointer, `inboxId`: RustBuffer.ByValue, + `ptr`: Pointer, + `inboxId`: RustBuffer.ByValue, ): Long fun uniffi_xmtpv3_fn_method_ffigroup_added_by_inbox_id( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_xmtpv3_fn_method_ffigroup_admin_list( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_xmtpv3_fn_method_ffigroup_created_at_ns( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Long fun uniffi_xmtpv3_fn_method_ffigroup_find_messages( - `ptr`: Pointer, `opts`: RustBuffer.ByValue, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + `opts`: RustBuffer.ByValue, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_xmtpv3_fn_method_ffigroup_group_description( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_xmtpv3_fn_method_ffigroup_group_image_url_square( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_xmtpv3_fn_method_ffigroup_group_metadata( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_xmtpv3_fn_method_ffigroup_group_name( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_xmtpv3_fn_method_ffigroup_group_permissions( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_xmtpv3_fn_method_ffigroup_group_pinned_frame_url( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_xmtpv3_fn_method_ffigroup_id( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_xmtpv3_fn_method_ffigroup_is_active( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Byte fun uniffi_xmtpv3_fn_method_ffigroup_is_admin( - `ptr`: Pointer, `inboxId`: RustBuffer.ByValue, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + `inboxId`: RustBuffer.ByValue, + uniffi_out_err: UniffiRustCallStatus, ): Byte fun uniffi_xmtpv3_fn_method_ffigroup_is_super_admin( - `ptr`: Pointer, `inboxId`: RustBuffer.ByValue, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + `inboxId`: RustBuffer.ByValue, + uniffi_out_err: UniffiRustCallStatus, ): Byte fun uniffi_xmtpv3_fn_method_ffigroup_list_members( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_xmtpv3_fn_method_ffigroup_process_streamed_group_message( - `ptr`: Pointer, `envelopeBytes`: RustBuffer.ByValue, - ): Long - - fun uniffi_xmtpv3_fn_method_ffigroup_publish_messages( `ptr`: Pointer, + `envelopeBytes`: RustBuffer.ByValue, ): Long + fun uniffi_xmtpv3_fn_method_ffigroup_publish_messages(`ptr`: Pointer): Long + fun uniffi_xmtpv3_fn_method_ffigroup_remove_admin( - `ptr`: Pointer, `inboxId`: RustBuffer.ByValue, + `ptr`: Pointer, + `inboxId`: RustBuffer.ByValue, ): Long fun uniffi_xmtpv3_fn_method_ffigroup_remove_members( - `ptr`: Pointer, `accountAddresses`: RustBuffer.ByValue, + `ptr`: Pointer, + `accountAddresses`: RustBuffer.ByValue, ): Long fun uniffi_xmtpv3_fn_method_ffigroup_remove_members_by_inbox_id( - `ptr`: Pointer, `inboxIds`: RustBuffer.ByValue, + `ptr`: Pointer, + `inboxIds`: RustBuffer.ByValue, ): Long fun uniffi_xmtpv3_fn_method_ffigroup_remove_super_admin( - `ptr`: Pointer, `inboxId`: RustBuffer.ByValue, + `ptr`: Pointer, + `inboxId`: RustBuffer.ByValue, ): Long fun uniffi_xmtpv3_fn_method_ffigroup_send( - `ptr`: Pointer, `contentBytes`: RustBuffer.ByValue, + `ptr`: Pointer, + `contentBytes`: RustBuffer.ByValue, ): Long fun uniffi_xmtpv3_fn_method_ffigroup_send_optimistic( - `ptr`: Pointer, `contentBytes`: RustBuffer.ByValue, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + `contentBytes`: RustBuffer.ByValue, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_xmtpv3_fn_method_ffigroup_stream( - `ptr`: Pointer, `messageCallback`: Long, + `ptr`: Pointer, + `messageCallback`: Long, ): Long fun uniffi_xmtpv3_fn_method_ffigroup_super_admin_list( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_xmtpv3_fn_method_ffigroup_sync( - `ptr`: Pointer, - ): Long + fun uniffi_xmtpv3_fn_method_ffigroup_sync(`ptr`: Pointer): Long fun uniffi_xmtpv3_fn_method_ffigroup_update_group_description( - `ptr`: Pointer, `groupDescription`: RustBuffer.ByValue, + `ptr`: Pointer, + `groupDescription`: RustBuffer.ByValue, ): Long fun uniffi_xmtpv3_fn_method_ffigroup_update_group_image_url_square( - `ptr`: Pointer, `groupImageUrlSquare`: RustBuffer.ByValue, + `ptr`: Pointer, + `groupImageUrlSquare`: RustBuffer.ByValue, ): Long fun uniffi_xmtpv3_fn_method_ffigroup_update_group_name( - `ptr`: Pointer, `groupName`: RustBuffer.ByValue, + `ptr`: Pointer, + `groupName`: RustBuffer.ByValue, ): Long fun uniffi_xmtpv3_fn_method_ffigroup_update_group_pinned_frame_url( - `ptr`: Pointer, `pinnedFrameUrl`: RustBuffer.ByValue, + `ptr`: Pointer, + `pinnedFrameUrl`: RustBuffer.ByValue, ): Long fun uniffi_xmtpv3_fn_method_ffigroup_update_permission_policy( @@ -1044,47 +1123,58 @@ internal interface UniffiLib : Library { ): Long fun uniffi_xmtpv3_fn_clone_ffigroupmetadata( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_xmtpv3_fn_free_ffigroupmetadata( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_xmtpv3_fn_method_ffigroupmetadata_conversation_type( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_xmtpv3_fn_method_ffigroupmetadata_creator_inbox_id( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_xmtpv3_fn_clone_ffigrouppermissions( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_xmtpv3_fn_free_ffigrouppermissions( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_xmtpv3_fn_method_ffigrouppermissions_policy_set( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_xmtpv3_fn_method_ffigrouppermissions_policy_type( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_xmtpv3_fn_clone_ffisignaturerequest( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_xmtpv3_fn_free_ffisignaturerequest( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_xmtpv3_fn_method_ffisignaturerequest_add_ecdsa_signature( - `ptr`: Pointer, `signatureBytes`: RustBuffer.ByValue, + `ptr`: Pointer, + `signatureBytes`: RustBuffer.ByValue, ): Long fun uniffi_xmtpv3_fn_method_ffisignaturerequest_add_scw_signature( @@ -1094,92 +1184,102 @@ internal interface UniffiLib : Library { `chainRpcUrl`: RustBuffer.ByValue, ): Long - fun uniffi_xmtpv3_fn_method_ffisignaturerequest_is_ready( - `ptr`: Pointer, - ): Long + fun uniffi_xmtpv3_fn_method_ffisignaturerequest_is_ready(`ptr`: Pointer): Long - fun uniffi_xmtpv3_fn_method_ffisignaturerequest_missing_address_signatures( - `ptr`: Pointer, - ): Long + fun uniffi_xmtpv3_fn_method_ffisignaturerequest_missing_address_signatures(`ptr`: Pointer): Long - fun uniffi_xmtpv3_fn_method_ffisignaturerequest_signature_text( - `ptr`: Pointer, - ): Long + fun uniffi_xmtpv3_fn_method_ffisignaturerequest_signature_text(`ptr`: Pointer): Long fun uniffi_xmtpv3_fn_clone_ffistreamcloser( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_xmtpv3_fn_free_ffistreamcloser( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_xmtpv3_fn_method_ffistreamcloser_end( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_xmtpv3_fn_method_ffistreamcloser_end_and_wait( - `ptr`: Pointer, - ): Long + fun uniffi_xmtpv3_fn_method_ffistreamcloser_end_and_wait(`ptr`: Pointer): Long fun uniffi_xmtpv3_fn_method_ffistreamcloser_is_closed( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Byte fun uniffi_xmtpv3_fn_clone_ffiv2apiclient( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_xmtpv3_fn_free_ffiv2apiclient( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_xmtpv3_fn_method_ffiv2apiclient_batch_query( - `ptr`: Pointer, `req`: RustBuffer.ByValue, + `ptr`: Pointer, + `req`: RustBuffer.ByValue, ): Long fun uniffi_xmtpv3_fn_method_ffiv2apiclient_publish( - `ptr`: Pointer, `request`: RustBuffer.ByValue, `authToken`: RustBuffer.ByValue, + `ptr`: Pointer, + `request`: RustBuffer.ByValue, + `authToken`: RustBuffer.ByValue, ): Long fun uniffi_xmtpv3_fn_method_ffiv2apiclient_query( - `ptr`: Pointer, `request`: RustBuffer.ByValue, + `ptr`: Pointer, + `request`: RustBuffer.ByValue, ): Long fun uniffi_xmtpv3_fn_method_ffiv2apiclient_set_app_version( - `ptr`: Pointer, `version`: RustBuffer.ByValue, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + `version`: RustBuffer.ByValue, + uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_xmtpv3_fn_method_ffiv2apiclient_subscribe( - `ptr`: Pointer, `request`: RustBuffer.ByValue, `callback`: Long, + `ptr`: Pointer, + `request`: RustBuffer.ByValue, + `callback`: Long, ): Long fun uniffi_xmtpv3_fn_clone_ffiv2subscription( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_xmtpv3_fn_free_ffiv2subscription( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_xmtpv3_fn_method_ffiv2subscription_end( - `ptr`: Pointer, - ): Long + fun uniffi_xmtpv3_fn_method_ffiv2subscription_end(`ptr`: Pointer): Long fun uniffi_xmtpv3_fn_method_ffiv2subscription_is_closed( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Byte fun uniffi_xmtpv3_fn_method_ffiv2subscription_update( - `ptr`: Pointer, `req`: RustBuffer.ByValue, + `ptr`: Pointer, + `req`: RustBuffer.ByValue, ): Long fun uniffi_xmtpv3_fn_clone_ffixmtpclient( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_xmtpv3_fn_free_ffixmtpclient( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_xmtpv3_fn_method_ffixmtpclient_add_wallet( @@ -1189,76 +1289,78 @@ internal interface UniffiLib : Library { ): Long fun uniffi_xmtpv3_fn_method_ffixmtpclient_apply_signature_request( - `ptr`: Pointer, `signatureRequest`: Pointer, + `ptr`: Pointer, + `signatureRequest`: Pointer, ): Long fun uniffi_xmtpv3_fn_method_ffixmtpclient_can_message( - `ptr`: Pointer, `accountAddresses`: RustBuffer.ByValue, + `ptr`: Pointer, + `accountAddresses`: RustBuffer.ByValue, ): Long fun uniffi_xmtpv3_fn_method_ffixmtpclient_conversations( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_xmtpv3_fn_method_ffixmtpclient_db_reconnect( - `ptr`: Pointer, - ): Long + fun uniffi_xmtpv3_fn_method_ffixmtpclient_db_reconnect(`ptr`: Pointer): Long fun uniffi_xmtpv3_fn_method_ffixmtpclient_find_inbox_id( - `ptr`: Pointer, `address`: RustBuffer.ByValue, + `ptr`: Pointer, + `address`: RustBuffer.ByValue, ): Long fun uniffi_xmtpv3_fn_method_ffixmtpclient_group( - `ptr`: Pointer, `groupId`: RustBuffer.ByValue, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + `groupId`: RustBuffer.ByValue, + uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_xmtpv3_fn_method_ffixmtpclient_inbox_id( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_xmtpv3_fn_method_ffixmtpclient_installation_id( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_xmtpv3_fn_method_ffixmtpclient_message( - `ptr`: Pointer, `messageId`: RustBuffer.ByValue, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + `messageId`: RustBuffer.ByValue, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_xmtpv3_fn_method_ffixmtpclient_register_identity( - `ptr`: Pointer, `signatureRequest`: Pointer, + `ptr`: Pointer, + `signatureRequest`: Pointer, ): Long fun uniffi_xmtpv3_fn_method_ffixmtpclient_release_db_connection( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_xmtpv3_fn_method_ffixmtpclient_request_history_sync( - `ptr`: Pointer, - ): Long + fun uniffi_xmtpv3_fn_method_ffixmtpclient_request_history_sync(`ptr`: Pointer): Long fun uniffi_xmtpv3_fn_method_ffixmtpclient_revoke_wallet( - `ptr`: Pointer, `walletAddress`: RustBuffer.ByValue, + `ptr`: Pointer, + `walletAddress`: RustBuffer.ByValue, ): Long fun uniffi_xmtpv3_fn_method_ffixmtpclient_signature_request( - `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + `ptr`: Pointer, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_xmtpv3_fn_init_callback_vtable_ffiinboxowner( - `vtable`: UniffiVTableCallbackInterfaceFfiInboxOwner, - ): Unit + fun uniffi_xmtpv3_fn_init_callback_vtable_ffiinboxowner(`vtable`: UniffiVTableCallbackInterfaceFfiInboxOwner): Unit - fun uniffi_xmtpv3_fn_init_callback_vtable_ffilogger( - `vtable`: UniffiVTableCallbackInterfaceFfiLogger, - ): Unit + fun uniffi_xmtpv3_fn_init_callback_vtable_ffilogger(`vtable`: UniffiVTableCallbackInterfaceFfiLogger): Unit - fun uniffi_xmtpv3_fn_init_callback_vtable_fficonversationcallback( - `vtable`: UniffiVTableCallbackInterfaceFfiConversationCallback, - ): Unit + fun uniffi_xmtpv3_fn_init_callback_vtable_fficonversationcallback(`vtable`: UniffiVTableCallbackInterfaceFfiConversationCallback): Unit - fun uniffi_xmtpv3_fn_init_callback_vtable_ffimessagecallback( - `vtable`: UniffiVTableCallbackInterfaceFfiMessageCallback, - ): Unit + fun uniffi_xmtpv3_fn_init_callback_vtable_ffimessagecallback(`vtable`: UniffiVTableCallbackInterfaceFfiMessageCallback): Unit fun uniffi_xmtpv3_fn_init_callback_vtable_ffiv2subscriptioncallback( `vtable`: UniffiVTableCallbackInterfaceFfiV2SubscriptionCallback, @@ -1278,7 +1380,8 @@ internal interface UniffiLib : Library { ): Long fun uniffi_xmtpv3_fn_func_create_v2_client( - `host`: RustBuffer.ByValue, `isSecure`: Byte, + `host`: RustBuffer.ByValue, + `isSecure`: Byte, ): Long fun uniffi_xmtpv3_fn_func_diffie_hellman_k256( @@ -1288,11 +1391,14 @@ internal interface UniffiLib : Library { ): RustBuffer.ByValue fun uniffi_xmtpv3_fn_func_generate_inbox_id( - `accountAddress`: RustBuffer.ByValue, `nonce`: Long, uniffi_out_err: UniffiRustCallStatus, + `accountAddress`: RustBuffer.ByValue, + `nonce`: Long, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_xmtpv3_fn_func_generate_private_preferences_topic_identifier( - `privateKey`: RustBuffer.ByValue, uniffi_out_err: UniffiRustCallStatus, + `privateKey`: RustBuffer.ByValue, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_xmtpv3_fn_func_get_inbox_id_for_address( @@ -1302,16 +1408,16 @@ internal interface UniffiLib : Library { `accountAddress`: RustBuffer.ByValue, ): Long - fun uniffi_xmtpv3_fn_func_get_version_info( - uniffi_out_err: UniffiRustCallStatus, - ): RustBuffer.ByValue + fun uniffi_xmtpv3_fn_func_get_version_info(uniffi_out_err: UniffiRustCallStatus): RustBuffer.ByValue fun uniffi_xmtpv3_fn_func_keccak256( - `input`: RustBuffer.ByValue, uniffi_out_err: UniffiRustCallStatus, + `input`: RustBuffer.ByValue, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_xmtpv3_fn_func_public_key_from_private_key_k256( - `privateKeyBytes`: RustBuffer.ByValue, uniffi_out_err: UniffiRustCallStatus, + `privateKeyBytes`: RustBuffer.ByValue, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_xmtpv3_fn_func_recover_address( @@ -1333,7 +1439,8 @@ internal interface UniffiLib : Library { ): RustBuffer.ByValue fun uniffi_xmtpv3_fn_func_sha256( - `input`: RustBuffer.ByValue, uniffi_out_err: UniffiRustCallStatus, + `input`: RustBuffer.ByValue, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_xmtpv3_fn_func_user_preferences_decrypt( @@ -1359,526 +1466,418 @@ internal interface UniffiLib : Library { ): Byte fun ffi_xmtpv3_rustbuffer_alloc( - `size`: Long, uniffi_out_err: UniffiRustCallStatus, + `size`: Long, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun ffi_xmtpv3_rustbuffer_from_bytes( - `bytes`: ForeignBytes.ByValue, uniffi_out_err: UniffiRustCallStatus, + `bytes`: ForeignBytes.ByValue, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun ffi_xmtpv3_rustbuffer_free( - `buf`: RustBuffer.ByValue, uniffi_out_err: UniffiRustCallStatus, + `buf`: RustBuffer.ByValue, + uniffi_out_err: UniffiRustCallStatus, ): Unit fun ffi_xmtpv3_rustbuffer_reserve( - `buf`: RustBuffer.ByValue, `additional`: Long, uniffi_out_err: UniffiRustCallStatus, + `buf`: RustBuffer.ByValue, + `additional`: Long, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun ffi_xmtpv3_rust_future_poll_u8( - `handle`: Long, `callback`: UniffiRustFutureContinuationCallback, `callbackData`: Long, - ): Unit - - fun ffi_xmtpv3_rust_future_cancel_u8( `handle`: Long, + `callback`: UniffiRustFutureContinuationCallback, + `callbackData`: Long, ): Unit - fun ffi_xmtpv3_rust_future_free_u8( - `handle`: Long, - ): Unit + fun ffi_xmtpv3_rust_future_cancel_u8(`handle`: Long): Unit + + fun ffi_xmtpv3_rust_future_free_u8(`handle`: Long): Unit fun ffi_xmtpv3_rust_future_complete_u8( - `handle`: Long, uniffi_out_err: UniffiRustCallStatus, + `handle`: Long, + uniffi_out_err: UniffiRustCallStatus, ): Byte fun ffi_xmtpv3_rust_future_poll_i8( - `handle`: Long, `callback`: UniffiRustFutureContinuationCallback, `callbackData`: Long, - ): Unit - - fun ffi_xmtpv3_rust_future_cancel_i8( `handle`: Long, + `callback`: UniffiRustFutureContinuationCallback, + `callbackData`: Long, ): Unit - fun ffi_xmtpv3_rust_future_free_i8( - `handle`: Long, - ): Unit + fun ffi_xmtpv3_rust_future_cancel_i8(`handle`: Long): Unit + + fun ffi_xmtpv3_rust_future_free_i8(`handle`: Long): Unit fun ffi_xmtpv3_rust_future_complete_i8( - `handle`: Long, uniffi_out_err: UniffiRustCallStatus, + `handle`: Long, + uniffi_out_err: UniffiRustCallStatus, ): Byte fun ffi_xmtpv3_rust_future_poll_u16( - `handle`: Long, `callback`: UniffiRustFutureContinuationCallback, `callbackData`: Long, - ): Unit - - fun ffi_xmtpv3_rust_future_cancel_u16( `handle`: Long, + `callback`: UniffiRustFutureContinuationCallback, + `callbackData`: Long, ): Unit - fun ffi_xmtpv3_rust_future_free_u16( - `handle`: Long, - ): Unit + fun ffi_xmtpv3_rust_future_cancel_u16(`handle`: Long): Unit + + fun ffi_xmtpv3_rust_future_free_u16(`handle`: Long): Unit fun ffi_xmtpv3_rust_future_complete_u16( - `handle`: Long, uniffi_out_err: UniffiRustCallStatus, + `handle`: Long, + uniffi_out_err: UniffiRustCallStatus, ): Short fun ffi_xmtpv3_rust_future_poll_i16( - `handle`: Long, `callback`: UniffiRustFutureContinuationCallback, `callbackData`: Long, - ): Unit - - fun ffi_xmtpv3_rust_future_cancel_i16( `handle`: Long, + `callback`: UniffiRustFutureContinuationCallback, + `callbackData`: Long, ): Unit - fun ffi_xmtpv3_rust_future_free_i16( - `handle`: Long, - ): Unit + fun ffi_xmtpv3_rust_future_cancel_i16(`handle`: Long): Unit + + fun ffi_xmtpv3_rust_future_free_i16(`handle`: Long): Unit fun ffi_xmtpv3_rust_future_complete_i16( - `handle`: Long, uniffi_out_err: UniffiRustCallStatus, + `handle`: Long, + uniffi_out_err: UniffiRustCallStatus, ): Short fun ffi_xmtpv3_rust_future_poll_u32( - `handle`: Long, `callback`: UniffiRustFutureContinuationCallback, `callbackData`: Long, - ): Unit - - fun ffi_xmtpv3_rust_future_cancel_u32( `handle`: Long, + `callback`: UniffiRustFutureContinuationCallback, + `callbackData`: Long, ): Unit - fun ffi_xmtpv3_rust_future_free_u32( - `handle`: Long, - ): Unit + fun ffi_xmtpv3_rust_future_cancel_u32(`handle`: Long): Unit + + fun ffi_xmtpv3_rust_future_free_u32(`handle`: Long): Unit fun ffi_xmtpv3_rust_future_complete_u32( - `handle`: Long, uniffi_out_err: UniffiRustCallStatus, + `handle`: Long, + uniffi_out_err: UniffiRustCallStatus, ): Int fun ffi_xmtpv3_rust_future_poll_i32( - `handle`: Long, `callback`: UniffiRustFutureContinuationCallback, `callbackData`: Long, - ): Unit - - fun ffi_xmtpv3_rust_future_cancel_i32( `handle`: Long, + `callback`: UniffiRustFutureContinuationCallback, + `callbackData`: Long, ): Unit - fun ffi_xmtpv3_rust_future_free_i32( - `handle`: Long, - ): Unit + fun ffi_xmtpv3_rust_future_cancel_i32(`handle`: Long): Unit + + fun ffi_xmtpv3_rust_future_free_i32(`handle`: Long): Unit fun ffi_xmtpv3_rust_future_complete_i32( - `handle`: Long, uniffi_out_err: UniffiRustCallStatus, + `handle`: Long, + uniffi_out_err: UniffiRustCallStatus, ): Int fun ffi_xmtpv3_rust_future_poll_u64( - `handle`: Long, `callback`: UniffiRustFutureContinuationCallback, `callbackData`: Long, - ): Unit - - fun ffi_xmtpv3_rust_future_cancel_u64( `handle`: Long, + `callback`: UniffiRustFutureContinuationCallback, + `callbackData`: Long, ): Unit - fun ffi_xmtpv3_rust_future_free_u64( - `handle`: Long, - ): Unit + fun ffi_xmtpv3_rust_future_cancel_u64(`handle`: Long): Unit + + fun ffi_xmtpv3_rust_future_free_u64(`handle`: Long): Unit fun ffi_xmtpv3_rust_future_complete_u64( - `handle`: Long, uniffi_out_err: UniffiRustCallStatus, + `handle`: Long, + uniffi_out_err: UniffiRustCallStatus, ): Long fun ffi_xmtpv3_rust_future_poll_i64( - `handle`: Long, `callback`: UniffiRustFutureContinuationCallback, `callbackData`: Long, - ): Unit - - fun ffi_xmtpv3_rust_future_cancel_i64( `handle`: Long, + `callback`: UniffiRustFutureContinuationCallback, + `callbackData`: Long, ): Unit - fun ffi_xmtpv3_rust_future_free_i64( - `handle`: Long, - ): Unit + fun ffi_xmtpv3_rust_future_cancel_i64(`handle`: Long): Unit + + fun ffi_xmtpv3_rust_future_free_i64(`handle`: Long): Unit fun ffi_xmtpv3_rust_future_complete_i64( - `handle`: Long, uniffi_out_err: UniffiRustCallStatus, + `handle`: Long, + uniffi_out_err: UniffiRustCallStatus, ): Long fun ffi_xmtpv3_rust_future_poll_f32( - `handle`: Long, `callback`: UniffiRustFutureContinuationCallback, `callbackData`: Long, - ): Unit - - fun ffi_xmtpv3_rust_future_cancel_f32( `handle`: Long, + `callback`: UniffiRustFutureContinuationCallback, + `callbackData`: Long, ): Unit - fun ffi_xmtpv3_rust_future_free_f32( - `handle`: Long, - ): Unit + fun ffi_xmtpv3_rust_future_cancel_f32(`handle`: Long): Unit + + fun ffi_xmtpv3_rust_future_free_f32(`handle`: Long): Unit fun ffi_xmtpv3_rust_future_complete_f32( - `handle`: Long, uniffi_out_err: UniffiRustCallStatus, + `handle`: Long, + uniffi_out_err: UniffiRustCallStatus, ): Float fun ffi_xmtpv3_rust_future_poll_f64( - `handle`: Long, `callback`: UniffiRustFutureContinuationCallback, `callbackData`: Long, - ): Unit - - fun ffi_xmtpv3_rust_future_cancel_f64( `handle`: Long, + `callback`: UniffiRustFutureContinuationCallback, + `callbackData`: Long, ): Unit - fun ffi_xmtpv3_rust_future_free_f64( - `handle`: Long, - ): Unit + fun ffi_xmtpv3_rust_future_cancel_f64(`handle`: Long): Unit + + fun ffi_xmtpv3_rust_future_free_f64(`handle`: Long): Unit fun ffi_xmtpv3_rust_future_complete_f64( - `handle`: Long, uniffi_out_err: UniffiRustCallStatus, + `handle`: Long, + uniffi_out_err: UniffiRustCallStatus, ): Double fun ffi_xmtpv3_rust_future_poll_pointer( - `handle`: Long, `callback`: UniffiRustFutureContinuationCallback, `callbackData`: Long, - ): Unit - - fun ffi_xmtpv3_rust_future_cancel_pointer( `handle`: Long, + `callback`: UniffiRustFutureContinuationCallback, + `callbackData`: Long, ): Unit - fun ffi_xmtpv3_rust_future_free_pointer( - `handle`: Long, - ): Unit + fun ffi_xmtpv3_rust_future_cancel_pointer(`handle`: Long): Unit + + fun ffi_xmtpv3_rust_future_free_pointer(`handle`: Long): Unit fun ffi_xmtpv3_rust_future_complete_pointer( - `handle`: Long, uniffi_out_err: UniffiRustCallStatus, + `handle`: Long, + uniffi_out_err: UniffiRustCallStatus, ): Pointer fun ffi_xmtpv3_rust_future_poll_rust_buffer( - `handle`: Long, `callback`: UniffiRustFutureContinuationCallback, `callbackData`: Long, - ): Unit - - fun ffi_xmtpv3_rust_future_cancel_rust_buffer( `handle`: Long, + `callback`: UniffiRustFutureContinuationCallback, + `callbackData`: Long, ): Unit - fun ffi_xmtpv3_rust_future_free_rust_buffer( - `handle`: Long, - ): Unit + fun ffi_xmtpv3_rust_future_cancel_rust_buffer(`handle`: Long): Unit + + fun ffi_xmtpv3_rust_future_free_rust_buffer(`handle`: Long): Unit fun ffi_xmtpv3_rust_future_complete_rust_buffer( - `handle`: Long, uniffi_out_err: UniffiRustCallStatus, + `handle`: Long, + uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun ffi_xmtpv3_rust_future_poll_void( - `handle`: Long, `callback`: UniffiRustFutureContinuationCallback, `callbackData`: Long, - ): Unit - - fun ffi_xmtpv3_rust_future_cancel_void( `handle`: Long, + `callback`: UniffiRustFutureContinuationCallback, + `callbackData`: Long, ): Unit - fun ffi_xmtpv3_rust_future_free_void( - `handle`: Long, - ): Unit + fun ffi_xmtpv3_rust_future_cancel_void(`handle`: Long): Unit + + fun ffi_xmtpv3_rust_future_free_void(`handle`: Long): Unit fun ffi_xmtpv3_rust_future_complete_void( - `handle`: Long, uniffi_out_err: UniffiRustCallStatus, + `handle`: Long, + uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_xmtpv3_checksum_func_create_client( - ): Short - - fun uniffi_xmtpv3_checksum_func_create_v2_client( - ): Short + fun uniffi_xmtpv3_checksum_func_create_client(): Short - fun uniffi_xmtpv3_checksum_func_diffie_hellman_k256( - ): Short + fun uniffi_xmtpv3_checksum_func_create_v2_client(): Short - fun uniffi_xmtpv3_checksum_func_generate_inbox_id( - ): Short + fun uniffi_xmtpv3_checksum_func_diffie_hellman_k256(): Short - fun uniffi_xmtpv3_checksum_func_generate_private_preferences_topic_identifier( - ): Short + fun uniffi_xmtpv3_checksum_func_generate_inbox_id(): Short - fun uniffi_xmtpv3_checksum_func_get_inbox_id_for_address( - ): Short + fun uniffi_xmtpv3_checksum_func_generate_private_preferences_topic_identifier(): Short - fun uniffi_xmtpv3_checksum_func_get_version_info( - ): Short + fun uniffi_xmtpv3_checksum_func_get_inbox_id_for_address(): Short - fun uniffi_xmtpv3_checksum_func_keccak256( - ): Short + fun uniffi_xmtpv3_checksum_func_get_version_info(): Short - fun uniffi_xmtpv3_checksum_func_public_key_from_private_key_k256( - ): Short + fun uniffi_xmtpv3_checksum_func_keccak256(): Short - fun uniffi_xmtpv3_checksum_func_recover_address( - ): Short + fun uniffi_xmtpv3_checksum_func_public_key_from_private_key_k256(): Short - fun uniffi_xmtpv3_checksum_func_recover_public_key_k256_keccak256( - ): Short + fun uniffi_xmtpv3_checksum_func_recover_address(): Short - fun uniffi_xmtpv3_checksum_func_recover_public_key_k256_sha256( - ): Short + fun uniffi_xmtpv3_checksum_func_recover_public_key_k256_keccak256(): Short - fun uniffi_xmtpv3_checksum_func_sha256( - ): Short + fun uniffi_xmtpv3_checksum_func_recover_public_key_k256_sha256(): Short - fun uniffi_xmtpv3_checksum_func_user_preferences_decrypt( - ): Short + fun uniffi_xmtpv3_checksum_func_sha256(): Short - fun uniffi_xmtpv3_checksum_func_user_preferences_encrypt( - ): Short + fun uniffi_xmtpv3_checksum_func_user_preferences_decrypt(): Short - fun uniffi_xmtpv3_checksum_func_verify_k256_sha256( - ): Short + fun uniffi_xmtpv3_checksum_func_user_preferences_encrypt(): Short - fun uniffi_xmtpv3_checksum_method_fficonversations_create_group( - ): Short + fun uniffi_xmtpv3_checksum_func_verify_k256_sha256(): Short - fun uniffi_xmtpv3_checksum_method_fficonversations_list( - ): Short + fun uniffi_xmtpv3_checksum_method_fficonversations_create_group(): Short - fun uniffi_xmtpv3_checksum_method_fficonversations_process_streamed_welcome_message( - ): Short + fun uniffi_xmtpv3_checksum_method_fficonversations_list(): Short - fun uniffi_xmtpv3_checksum_method_fficonversations_stream( - ): Short + fun uniffi_xmtpv3_checksum_method_fficonversations_process_streamed_welcome_message(): Short - fun uniffi_xmtpv3_checksum_method_fficonversations_stream_all_messages( - ): Short + fun uniffi_xmtpv3_checksum_method_fficonversations_stream(): Short - fun uniffi_xmtpv3_checksum_method_fficonversations_sync( - ): Short + fun uniffi_xmtpv3_checksum_method_fficonversations_stream_all_messages(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_add_admin( - ): Short + fun uniffi_xmtpv3_checksum_method_fficonversations_sync(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_add_members( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_add_admin(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_add_members_by_inbox_id( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_add_members(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_add_super_admin( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_add_members_by_inbox_id(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_added_by_inbox_id( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_add_super_admin(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_admin_list( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_added_by_inbox_id(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_created_at_ns( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_admin_list(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_find_messages( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_created_at_ns(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_group_description( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_find_messages(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_group_image_url_square( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_group_description(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_group_metadata( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_group_image_url_square(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_group_name( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_group_metadata(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_group_permissions( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_group_name(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_group_pinned_frame_url( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_group_permissions(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_id( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_group_pinned_frame_url(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_is_active( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_id(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_is_admin( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_is_active(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_is_super_admin( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_is_admin(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_list_members( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_is_super_admin(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_process_streamed_group_message( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_list_members(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_publish_messages( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_process_streamed_group_message(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_remove_admin( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_publish_messages(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_remove_members( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_remove_admin(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_remove_members_by_inbox_id( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_remove_members(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_remove_super_admin( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_remove_members_by_inbox_id(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_send( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_remove_super_admin(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_send_optimistic( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_send(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_stream( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_send_optimistic(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_super_admin_list( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_stream(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_sync( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_super_admin_list(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_update_group_description( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_sync(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_update_group_image_url_square( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_update_group_description(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_update_group_name( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_update_group_image_url_square(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_update_group_pinned_frame_url( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_update_group_name(): Short - fun uniffi_xmtpv3_checksum_method_ffigroup_update_permission_policy( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_update_group_pinned_frame_url(): Short - fun uniffi_xmtpv3_checksum_method_ffigroupmetadata_conversation_type( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_update_permission_policy(): Short - fun uniffi_xmtpv3_checksum_method_ffigroupmetadata_creator_inbox_id( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroupmetadata_conversation_type(): Short - fun uniffi_xmtpv3_checksum_method_ffigrouppermissions_policy_set( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigroupmetadata_creator_inbox_id(): Short - fun uniffi_xmtpv3_checksum_method_ffigrouppermissions_policy_type( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigrouppermissions_policy_set(): Short - fun uniffi_xmtpv3_checksum_method_ffisignaturerequest_add_ecdsa_signature( - ): Short + fun uniffi_xmtpv3_checksum_method_ffigrouppermissions_policy_type(): Short - fun uniffi_xmtpv3_checksum_method_ffisignaturerequest_add_scw_signature( - ): Short + fun uniffi_xmtpv3_checksum_method_ffisignaturerequest_add_ecdsa_signature(): Short - fun uniffi_xmtpv3_checksum_method_ffisignaturerequest_is_ready( - ): Short + fun uniffi_xmtpv3_checksum_method_ffisignaturerequest_add_scw_signature(): Short - fun uniffi_xmtpv3_checksum_method_ffisignaturerequest_missing_address_signatures( - ): Short + fun uniffi_xmtpv3_checksum_method_ffisignaturerequest_is_ready(): Short - fun uniffi_xmtpv3_checksum_method_ffisignaturerequest_signature_text( - ): Short + fun uniffi_xmtpv3_checksum_method_ffisignaturerequest_missing_address_signatures(): Short - fun uniffi_xmtpv3_checksum_method_ffistreamcloser_end( - ): Short + fun uniffi_xmtpv3_checksum_method_ffisignaturerequest_signature_text(): Short - fun uniffi_xmtpv3_checksum_method_ffistreamcloser_end_and_wait( - ): Short + fun uniffi_xmtpv3_checksum_method_ffistreamcloser_end(): Short - fun uniffi_xmtpv3_checksum_method_ffistreamcloser_is_closed( - ): Short + fun uniffi_xmtpv3_checksum_method_ffistreamcloser_end_and_wait(): Short - fun uniffi_xmtpv3_checksum_method_ffiv2apiclient_batch_query( - ): Short + fun uniffi_xmtpv3_checksum_method_ffistreamcloser_is_closed(): Short - fun uniffi_xmtpv3_checksum_method_ffiv2apiclient_publish( - ): Short + fun uniffi_xmtpv3_checksum_method_ffiv2apiclient_batch_query(): Short - fun uniffi_xmtpv3_checksum_method_ffiv2apiclient_query( - ): Short + fun uniffi_xmtpv3_checksum_method_ffiv2apiclient_publish(): Short - fun uniffi_xmtpv3_checksum_method_ffiv2apiclient_set_app_version( - ): Short + fun uniffi_xmtpv3_checksum_method_ffiv2apiclient_query(): Short - fun uniffi_xmtpv3_checksum_method_ffiv2apiclient_subscribe( - ): Short + fun uniffi_xmtpv3_checksum_method_ffiv2apiclient_set_app_version(): Short - fun uniffi_xmtpv3_checksum_method_ffiv2subscription_end( - ): Short + fun uniffi_xmtpv3_checksum_method_ffiv2apiclient_subscribe(): Short - fun uniffi_xmtpv3_checksum_method_ffiv2subscription_is_closed( - ): Short + fun uniffi_xmtpv3_checksum_method_ffiv2subscription_end(): Short - fun uniffi_xmtpv3_checksum_method_ffiv2subscription_update( - ): Short + fun uniffi_xmtpv3_checksum_method_ffiv2subscription_is_closed(): Short - fun uniffi_xmtpv3_checksum_method_ffixmtpclient_add_wallet( - ): Short + fun uniffi_xmtpv3_checksum_method_ffiv2subscription_update(): Short - fun uniffi_xmtpv3_checksum_method_ffixmtpclient_apply_signature_request( - ): Short + fun uniffi_xmtpv3_checksum_method_ffixmtpclient_add_wallet(): Short - fun uniffi_xmtpv3_checksum_method_ffixmtpclient_can_message( - ): Short + fun uniffi_xmtpv3_checksum_method_ffixmtpclient_apply_signature_request(): Short - fun uniffi_xmtpv3_checksum_method_ffixmtpclient_conversations( - ): Short + fun uniffi_xmtpv3_checksum_method_ffixmtpclient_can_message(): Short - fun uniffi_xmtpv3_checksum_method_ffixmtpclient_db_reconnect( - ): Short + fun uniffi_xmtpv3_checksum_method_ffixmtpclient_conversations(): Short - fun uniffi_xmtpv3_checksum_method_ffixmtpclient_find_inbox_id( - ): Short + fun uniffi_xmtpv3_checksum_method_ffixmtpclient_db_reconnect(): Short - fun uniffi_xmtpv3_checksum_method_ffixmtpclient_group( - ): Short + fun uniffi_xmtpv3_checksum_method_ffixmtpclient_find_inbox_id(): Short - fun uniffi_xmtpv3_checksum_method_ffixmtpclient_inbox_id( - ): Short + fun uniffi_xmtpv3_checksum_method_ffixmtpclient_group(): Short - fun uniffi_xmtpv3_checksum_method_ffixmtpclient_installation_id( - ): Short + fun uniffi_xmtpv3_checksum_method_ffixmtpclient_inbox_id(): Short - fun uniffi_xmtpv3_checksum_method_ffixmtpclient_message( - ): Short + fun uniffi_xmtpv3_checksum_method_ffixmtpclient_installation_id(): Short - fun uniffi_xmtpv3_checksum_method_ffixmtpclient_register_identity( - ): Short + fun uniffi_xmtpv3_checksum_method_ffixmtpclient_message(): Short - fun uniffi_xmtpv3_checksum_method_ffixmtpclient_release_db_connection( - ): Short + fun uniffi_xmtpv3_checksum_method_ffixmtpclient_register_identity(): Short - fun uniffi_xmtpv3_checksum_method_ffixmtpclient_request_history_sync( - ): Short + fun uniffi_xmtpv3_checksum_method_ffixmtpclient_release_db_connection(): Short - fun uniffi_xmtpv3_checksum_method_ffixmtpclient_revoke_wallet( - ): Short + fun uniffi_xmtpv3_checksum_method_ffixmtpclient_request_history_sync(): Short - fun uniffi_xmtpv3_checksum_method_ffixmtpclient_signature_request( - ): Short + fun uniffi_xmtpv3_checksum_method_ffixmtpclient_revoke_wallet(): Short - fun uniffi_xmtpv3_checksum_method_ffiinboxowner_get_address( - ): Short + fun uniffi_xmtpv3_checksum_method_ffixmtpclient_signature_request(): Short - fun uniffi_xmtpv3_checksum_method_ffiinboxowner_sign( - ): Short + fun uniffi_xmtpv3_checksum_method_ffiinboxowner_get_address(): Short - fun uniffi_xmtpv3_checksum_method_ffilogger_log( - ): Short + fun uniffi_xmtpv3_checksum_method_ffiinboxowner_sign(): Short - fun uniffi_xmtpv3_checksum_method_fficonversationcallback_on_conversation( - ): Short + fun uniffi_xmtpv3_checksum_method_ffilogger_log(): Short - fun uniffi_xmtpv3_checksum_method_ffimessagecallback_on_message( - ): Short + fun uniffi_xmtpv3_checksum_method_fficonversationcallback_on_conversation(): Short - fun uniffi_xmtpv3_checksum_method_ffiv2subscriptioncallback_on_message( - ): Short + fun uniffi_xmtpv3_checksum_method_ffimessagecallback_on_message(): Short - fun ffi_xmtpv3_uniffi_contract_version( - ): Int + fun uniffi_xmtpv3_checksum_method_ffiv2subscriptioncallback_on_message(): Short + fun ffi_xmtpv3_uniffi_contract_version(): Int } private fun uniffiCheckContractApiVersion(lib: UniffiLib) { @@ -2199,7 +2198,10 @@ internal val uniffiContinuationHandleMap = UniffiHandleMap uniffiRustCallAsync( completeFunc: (Long, UniffiRustCallStatus) -> F, freeFunc: (Long) -> Unit, liftFunc: (F) -> T, - errorHandler: UniffiRustCallStatusErrorHandler + errorHandler: UniffiRustCallStatusErrorHandler, ): T { try { do { - val pollResult = suspendCancellableCoroutine { continuation -> - pollFunc( - rustFuture, - uniffiRustFutureContinuationCallbackImpl, - uniffiContinuationHandleMap.insert(continuation) - ) - } - } while (pollResult != UNIFFI_RUST_FUTURE_POLL_READY); + val pollResult = + suspendCancellableCoroutine { continuation -> + pollFunc( + rustFuture, + uniffiRustFutureContinuationCallbackImpl, + uniffiContinuationHandleMap.insert(continuation), + ) + } + } while (pollResult != UNIFFI_RUST_FUTURE_POLL_READY) return liftFunc( - uniffiRustCallWithError(errorHandler, { status -> completeFunc(rustFuture, status) }) + uniffiRustCallWithError(errorHandler, { status -> completeFunc(rustFuture, status) }), ) } finally { freeFunc(rustFuture) @@ -2233,7 +2236,6 @@ internal suspend fun uniffiRustCallAsync( // Public interface members begin here. - // Interface implemented by anything that can contain an object reference. // // Such types expose a `destroy()` method that must be called to cleanly @@ -2247,7 +2249,8 @@ interface Disposable { companion object { fun destroy(vararg args: Any?) { - args.filterIsInstance() + args + .filterIsInstance() .forEach(Disposable::destroy) } } @@ -2269,101 +2272,86 @@ inline fun T.use(block: (T) -> R) = object NoPointer public object FfiConverterUByte : FfiConverter { - override fun lift(value: Byte): UByte { - return value.toUByte() - } + override fun lift(value: Byte): UByte = value.toUByte() - override fun read(buf: ByteBuffer): UByte { - return lift(buf.get()) - } + override fun read(buf: ByteBuffer): UByte = lift(buf.get()) - override fun lower(value: UByte): Byte { - return value.toByte() - } + override fun lower(value: UByte): Byte = value.toByte() override fun allocationSize(value: UByte) = 1UL - override fun write(value: UByte, buf: ByteBuffer) { + override fun write( + value: UByte, + buf: ByteBuffer, + ) { buf.put(value.toByte()) } } public object FfiConverterUInt : FfiConverter { - override fun lift(value: Int): UInt { - return value.toUInt() - } + override fun lift(value: Int): UInt = value.toUInt() - override fun read(buf: ByteBuffer): UInt { - return lift(buf.getInt()) - } + override fun read(buf: ByteBuffer): UInt = lift(buf.getInt()) - override fun lower(value: UInt): Int { - return value.toInt() - } + override fun lower(value: UInt): Int = value.toInt() override fun allocationSize(value: UInt) = 4UL - override fun write(value: UInt, buf: ByteBuffer) { + override fun write( + value: UInt, + buf: ByteBuffer, + ) { buf.putInt(value.toInt()) } } public object FfiConverterULong : FfiConverter { - override fun lift(value: Long): ULong { - return value.toULong() - } + override fun lift(value: Long): ULong = value.toULong() - override fun read(buf: ByteBuffer): ULong { - return lift(buf.getLong()) - } + override fun read(buf: ByteBuffer): ULong = lift(buf.getLong()) - override fun lower(value: ULong): Long { - return value.toLong() - } + override fun lower(value: ULong): Long = value.toLong() override fun allocationSize(value: ULong) = 8UL - override fun write(value: ULong, buf: ByteBuffer) { + override fun write( + value: ULong, + buf: ByteBuffer, + ) { buf.putLong(value.toLong()) } } public object FfiConverterLong : FfiConverter { - override fun lift(value: Long): Long { - return value - } + override fun lift(value: Long): Long = value - override fun read(buf: ByteBuffer): Long { - return buf.getLong() - } + override fun read(buf: ByteBuffer): Long = buf.getLong() - override fun lower(value: Long): Long { - return value - } + override fun lower(value: Long): Long = value override fun allocationSize(value: Long) = 8UL - override fun write(value: Long, buf: ByteBuffer) { + override fun write( + value: Long, + buf: ByteBuffer, + ) { buf.putLong(value) } } public object FfiConverterBoolean : FfiConverter { - override fun lift(value: Byte): Boolean { - return value.toInt() != 0 - } + override fun lift(value: Byte): Boolean = value.toInt() != 0 - override fun read(buf: ByteBuffer): Boolean { - return lift(buf.get()) - } + override fun read(buf: ByteBuffer): Boolean = lift(buf.get()) - override fun lower(value: Boolean): Byte { - return if (value) 1.toByte() else 0.toByte() - } + override fun lower(value: Boolean): Byte = if (value) 1.toByte() else 0.toByte() override fun allocationSize(value: Boolean) = 1UL - override fun write(value: Boolean, buf: ByteBuffer) { + override fun write( + value: Boolean, + buf: ByteBuffer, + ) { buf.put(lower(value)) } } @@ -2415,7 +2403,10 @@ public object FfiConverterString : FfiConverter { return sizeForLength + sizeForString } - override fun write(value: String, buf: ByteBuffer) { + override fun write( + value: String, + buf: ByteBuffer, + ) { val byteBuf = toUtf8(value) buf.putInt(byteBuf.limit()) buf.put(byteBuf) @@ -2430,17 +2421,17 @@ public object FfiConverterByteArray : FfiConverterRustBuffer { return byteArr } - override fun allocationSize(value: ByteArray): ULong { - return 4UL + value.size.toULong() - } + override fun allocationSize(value: ByteArray): ULong = 4UL + value.size.toULong() - override fun write(value: ByteArray, buf: ByteBuffer) { + override fun write( + value: ByteArray, + buf: ByteBuffer, + ) { buf.putInt(value.size) buf.put(value) } } - // This template implements a class for working with a Rust struct via a Pointer/Arc // to the live Rust struct on the other side of the FFI. // @@ -2538,7 +2529,6 @@ public object FfiConverterByteArray : FfiConverterRustBuffer { // [1] https://stackoverflow.com/questions/24376768/can-java-finalize-an-object-when-it-is-still-in-scope/24380219 // - // The cleaner interface for Object finalization code to run. // This is the entry point to any implementation that we're using. // @@ -2550,17 +2540,24 @@ interface UniffiCleaner { fun clean() } - fun register(value: Any, cleanUpTask: Runnable): UniffiCleaner.Cleanable + fun register( + value: Any, + cleanUpTask: Runnable, + ): UniffiCleaner.Cleanable companion object } // The fallback Jna cleaner, which is available for both Android, and the JVM. private class UniffiJnaCleaner : UniffiCleaner { - private val cleaner = com.sun.jna.internal.Cleaner.getCleaner() + private val cleaner = + com.sun.jna.internal.Cleaner + .getCleaner() - override fun register(value: Any, cleanUpTask: Runnable): UniffiCleaner.Cleanable = - UniffiJnaCleanable(cleaner.register(value, cleanUpTask)) + override fun register( + value: Any, + cleanUpTask: Runnable, + ): UniffiCleaner.Cleanable = UniffiJnaCleanable(cleaner.register(value, cleanUpTask)) } private class UniffiJnaCleanable( @@ -2587,23 +2584,26 @@ private fun UniffiCleaner.Companion.create(): UniffiCleaner = } private class JavaLangRefCleaner : UniffiCleaner { - val cleaner = java.lang.ref.Cleaner.create() + val cleaner = + java.lang.ref.Cleaner + .create() - override fun register(value: Any, cleanUpTask: Runnable): UniffiCleaner.Cleanable = - JavaLangRefCleanable(cleaner.register(value, cleanUpTask)) + override fun register( + value: Any, + cleanUpTask: Runnable, + ): UniffiCleaner.Cleanable = JavaLangRefCleanable(cleaner.register(value, cleanUpTask)) } private class JavaLangRefCleanable( - val cleanable: java.lang.ref.Cleaner.Cleanable + val cleanable: java.lang.ref.Cleaner.Cleanable, ) : UniffiCleaner.Cleanable { override fun clean() = cleanable.clean() } public interface FfiConversationsInterface { - suspend fun `createGroup`( `accountAddresses`: List, - `opts`: FfiCreateGroupOptions + `opts`: FfiCreateGroupOptions, ): FfiGroup suspend fun `list`(`opts`: FfiListConversationsOptions): List @@ -2619,8 +2619,10 @@ public interface FfiConversationsInterface { companion object } -open class FfiConversations : Disposable, AutoCloseable, FfiConversationsInterface { - +open class FfiConversations : + Disposable, + AutoCloseable, + FfiConversationsInterface { constructor(pointer: Pointer) { this.pointer = pointer this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) @@ -2684,7 +2686,9 @@ open class FfiConversations : Disposable, AutoCloseable, FfiConversationsInterfa // Use a static inner class instead of a closure so as not to accidentally // capture `this` as part of the cleanable's action. - private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { + private class UniffiCleanAction( + private val pointer: Pointer?, + ) : Runnable { override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> @@ -2694,20 +2698,18 @@ open class FfiConversations : Disposable, AutoCloseable, FfiConversationsInterfa } } - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> + fun uniffiClonePointer(): Pointer = + uniffiRustCall { status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_clone_fficonversations(pointer!!, status) } - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") override suspend fun `createGroup`( `accountAddresses`: List, - `opts`: FfiCreateGroupOptions - ): FfiGroup { - return uniffiRustCallAsync( + `opts`: FfiCreateGroupOptions, + ): FfiGroup = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_fficonversations_create_group( thisPtr, @@ -2715,200 +2717,120 @@ open class FfiConversations : Disposable, AutoCloseable, FfiConversationsInterfa FfiConverterTypeFfiCreateGroupOptions.lower(`opts`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_pointer( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_pointer( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_pointer(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_pointer(future) }, // lift function { FfiConverterTypeFfiGroup.lift(it) }, // Error FFI converter GenericException.ErrorHandler, ) - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `list`(`opts`: FfiListConversationsOptions): List { - return uniffiRustCallAsync( + override suspend fun `list`(`opts`: FfiListConversationsOptions): List = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_fficonversations_list( thisPtr, FfiConverterTypeFfiListConversationsOptions.lower(`opts`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_rust_buffer( + { future, callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_rust_buffer( - future, - continuation - ) + continuation, + -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_rust_buffer(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterSequenceTypeFfiGroup.lift(it) }, // Error FFI converter GenericException.ErrorHandler, ) - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `processStreamedWelcomeMessage`(`envelopeBytes`: kotlin.ByteArray): FfiGroup { - return uniffiRustCallAsync( + override suspend fun `processStreamedWelcomeMessage`(`envelopeBytes`: kotlin.ByteArray): FfiGroup = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_fficonversations_process_streamed_welcome_message( thisPtr, FfiConverterByteArray.lower(`envelopeBytes`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_pointer( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_pointer( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_pointer(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_pointer(future) }, // lift function { FfiConverterTypeFfiGroup.lift(it) }, // Error FFI converter GenericException.ErrorHandler, ) - } - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `stream`(`callback`: FfiConversationCallback): FfiStreamCloser { - return uniffiRustCallAsync( + override suspend fun `stream`(`callback`: FfiConversationCallback): FfiStreamCloser = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_fficonversations_stream( thisPtr, FfiConverterTypeFfiConversationCallback.lower(`callback`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_pointer( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_pointer( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_pointer(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_pointer(future) }, // lift function { FfiConverterTypeFfiStreamCloser.lift(it) }, // Error FFI converter UniffiNullRustCallStatusErrorHandler, ) - } - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `streamAllMessages`(`messageCallback`: FfiMessageCallback): FfiStreamCloser { - return uniffiRustCallAsync( + override suspend fun `streamAllMessages`(`messageCallback`: FfiMessageCallback): FfiStreamCloser = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_fficonversations_stream_all_messages( thisPtr, FfiConverterTypeFfiMessageCallback.lower(`messageCallback`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_pointer( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_pointer( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_pointer(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_pointer(future) }, // lift function { FfiConverterTypeFfiStreamCloser.lift(it) }, // Error FFI converter UniffiNullRustCallStatusErrorHandler, ) - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `sync`() { - return uniffiRustCallAsync( + override suspend fun `sync`() = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_fficonversations_sync( thisPtr, - - ) - }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation ) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, // lift function { Unit }, - // Error FFI converter GenericException.ErrorHandler, ) - } - companion object - } public object FfiConverterTypeFfiConversations : FfiConverter { + override fun lower(value: FfiConversations): Pointer = value.uniffiClonePointer() - override fun lower(value: FfiConversations): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): FfiConversations { - return FfiConversations(value) - } + override fun lift(value: Pointer): FfiConversations = FfiConversations(value) override fun read(buf: ByteBuffer): FfiConversations { // The Rust code always writes pointers as 8 bytes, and will @@ -2918,14 +2840,16 @@ public object FfiConverterTypeFfiConversations : FfiConverter // to the live Rust struct on the other side of the FFI. // @@ -3023,9 +2947,7 @@ public object FfiConverterTypeFfiConversations : FfiConverter) @@ -3103,14 +3025,16 @@ public interface FfiGroupInterface { suspend fun `updatePermissionPolicy`( `permissionUpdateType`: FfiPermissionUpdateType, `permissionPolicyOption`: FfiPermissionPolicy, - `metadataField`: FfiMetadataField? + `metadataField`: FfiMetadataField?, ) companion object } -open class FfiGroup : Disposable, AutoCloseable, FfiGroupInterface { - +open class FfiGroup : + Disposable, + AutoCloseable, + FfiGroupInterface { constructor(pointer: Pointer) { this.pointer = pointer this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) @@ -3174,7 +3098,9 @@ open class FfiGroup : Disposable, AutoCloseable, FfiGroupInterface { // Use a static inner class instead of a closure so as not to accidentally // capture `this` as part of the cleanable's action. - private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { + private class UniffiCleanAction( + private val pointer: Pointer?, + ) : Runnable { override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> @@ -3184,864 +3110,633 @@ open class FfiGroup : Disposable, AutoCloseable, FfiGroupInterface { } } - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> + fun uniffiClonePointer(): Pointer = + uniffiRustCall { status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_clone_ffigroup(pointer!!, status) } - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `addAdmin`(`inboxId`: kotlin.String) { - return uniffiRustCallAsync( + override suspend fun `addAdmin`(`inboxId`: kotlin.String) = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_add_admin( thisPtr, FfiConverterString.lower(`inboxId`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, // lift function { Unit }, - // Error FFI converter GenericException.ErrorHandler, ) - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `addMembers`(`accountAddresses`: List) { - return uniffiRustCallAsync( + override suspend fun `addMembers`(`accountAddresses`: List) = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_add_members( thisPtr, FfiConverterSequenceString.lower(`accountAddresses`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, // lift function { Unit }, - // Error FFI converter GenericException.ErrorHandler, ) - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `addMembersByInboxId`(`inboxIds`: List) { - return uniffiRustCallAsync( + override suspend fun `addMembersByInboxId`(`inboxIds`: List) = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_add_members_by_inbox_id( thisPtr, FfiConverterSequenceString.lower(`inboxIds`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, // lift function { Unit }, - // Error FFI converter GenericException.ErrorHandler, ) - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `addSuperAdmin`(`inboxId`: kotlin.String) { - return uniffiRustCallAsync( + override suspend fun `addSuperAdmin`(`inboxId`: kotlin.String) = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_add_super_admin( thisPtr, FfiConverterString.lower(`inboxId`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, // lift function { Unit }, - // Error FFI converter GenericException.ErrorHandler, ) - } - - @Throws(GenericException::class) - override fun `addedByInboxId`(): kotlin.String { - return FfiConverterString.lift( + @Throws( + GenericException::class, + ) + override fun `addedByInboxId`(): kotlin.String = + FfiConverterString.lift( callWithPointer { uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_added_by_inbox_id( - it, _status + it, + _status, ) } - } + }, ) - } - - @Throws(GenericException::class) - override fun `adminList`(): List { - return FfiConverterSequenceString.lift( + @Throws( + GenericException::class, + ) + override fun `adminList`(): List = + FfiConverterSequenceString.lift( callWithPointer { uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_admin_list( - it, _status + it, + _status, ) } - } + }, ) - } - - override fun `createdAtNs`(): kotlin.Long { - return FfiConverterLong.lift( + override fun `createdAtNs`(): kotlin.Long = + FfiConverterLong.lift( callWithPointer { - uniffiRustCall() { _status -> + uniffiRustCall { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_created_at_ns( - it, _status + it, + _status, ) } - } + }, ) - } - - @Throws(GenericException::class) - override fun `findMessages`(`opts`: FfiListMessagesOptions): List { - return FfiConverterSequenceTypeFfiMessage.lift( + @Throws( + GenericException::class, + ) + override fun `findMessages`(`opts`: FfiListMessagesOptions): List = + FfiConverterSequenceTypeFfiMessage.lift( callWithPointer { uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_find_messages( - it, FfiConverterTypeFfiListMessagesOptions.lower(`opts`), _status + it, + FfiConverterTypeFfiListMessagesOptions.lower(`opts`), + _status, ) } - } + }, ) - } - - @Throws(GenericException::class) - override fun `groupDescription`(): kotlin.String { - return FfiConverterString.lift( + @Throws( + GenericException::class, + ) + override fun `groupDescription`(): kotlin.String = + FfiConverterString.lift( callWithPointer { uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_group_description( - it, _status + it, + _status, ) } - } + }, ) - } - - @Throws(GenericException::class) - override fun `groupImageUrlSquare`(): kotlin.String { - return FfiConverterString.lift( + @Throws( + GenericException::class, + ) + override fun `groupImageUrlSquare`(): kotlin.String = + FfiConverterString.lift( callWithPointer { uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_group_image_url_square( - it, _status + it, + _status, ) } - } + }, ) - } - - @Throws(GenericException::class) - override fun `groupMetadata`(): FfiGroupMetadata { - return FfiConverterTypeFfiGroupMetadata.lift( + @Throws( + GenericException::class, + ) + override fun `groupMetadata`(): FfiGroupMetadata = + FfiConverterTypeFfiGroupMetadata.lift( callWithPointer { uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_group_metadata( - it, _status + it, + _status, ) } - } + }, ) - } - - @Throws(GenericException::class) - override fun `groupName`(): kotlin.String { - return FfiConverterString.lift( + @Throws( + GenericException::class, + ) + override fun `groupName`(): kotlin.String = + FfiConverterString.lift( callWithPointer { uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_group_name( - it, _status + it, + _status, ) } - } + }, ) - } - - @Throws(GenericException::class) - override fun `groupPermissions`(): FfiGroupPermissions { - return FfiConverterTypeFfiGroupPermissions.lift( + @Throws( + GenericException::class, + ) + override fun `groupPermissions`(): FfiGroupPermissions = + FfiConverterTypeFfiGroupPermissions.lift( callWithPointer { uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_group_permissions( - it, _status + it, + _status, ) } - } + }, ) - } - - @Throws(GenericException::class) - override fun `groupPinnedFrameUrl`(): kotlin.String { - return FfiConverterString.lift( + @Throws( + GenericException::class, + ) + override fun `groupPinnedFrameUrl`(): kotlin.String = + FfiConverterString.lift( callWithPointer { uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_group_pinned_frame_url( - it, _status + it, + _status, ) } - } + }, ) - } - - override fun `id`(): kotlin.ByteArray { - return FfiConverterByteArray.lift( + override fun `id`(): kotlin.ByteArray = + FfiConverterByteArray.lift( callWithPointer { - uniffiRustCall() { _status -> + uniffiRustCall { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_id( - it, _status + it, + _status, ) } - } + }, ) - } - - @Throws(GenericException::class) - override fun `isActive`(): kotlin.Boolean { - return FfiConverterBoolean.lift( + @Throws( + GenericException::class, + ) + override fun `isActive`(): kotlin.Boolean = + FfiConverterBoolean.lift( callWithPointer { uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_is_active( - it, _status + it, + _status, ) } - } + }, ) - } - - @Throws(GenericException::class) - override fun `isAdmin`(`inboxId`: kotlin.String): kotlin.Boolean { - return FfiConverterBoolean.lift( + @Throws( + GenericException::class, + ) + override fun `isAdmin`(`inboxId`: kotlin.String): kotlin.Boolean = + FfiConverterBoolean.lift( callWithPointer { uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_is_admin( - it, FfiConverterString.lower(`inboxId`), _status + it, + FfiConverterString.lower(`inboxId`), + _status, ) } - } + }, ) - } - - @Throws(GenericException::class) - override fun `isSuperAdmin`(`inboxId`: kotlin.String): kotlin.Boolean { - return FfiConverterBoolean.lift( + @Throws( + GenericException::class, + ) + override fun `isSuperAdmin`(`inboxId`: kotlin.String): kotlin.Boolean = + FfiConverterBoolean.lift( callWithPointer { uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_is_super_admin( - it, FfiConverterString.lower(`inboxId`), _status + it, + FfiConverterString.lower(`inboxId`), + _status, ) } - } + }, ) - } - - @Throws(GenericException::class) - override fun `listMembers`(): List { - return FfiConverterSequenceTypeFfiGroupMember.lift( + @Throws( + GenericException::class, + ) + override fun `listMembers`(): List = + FfiConverterSequenceTypeFfiGroupMember.lift( callWithPointer { uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_list_members( - it, _status + it, + _status, ) } - } + }, ) - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `processStreamedGroupMessage`(`envelopeBytes`: kotlin.ByteArray): FfiMessage { - return uniffiRustCallAsync( + override suspend fun `processStreamedGroupMessage`(`envelopeBytes`: kotlin.ByteArray): FfiMessage = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_process_streamed_group_message( thisPtr, FfiConverterByteArray.lower(`envelopeBytes`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_rust_buffer( + { future, callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_rust_buffer( - future, - continuation - ) + continuation, + -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_rust_buffer(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterTypeFfiMessage.lift(it) }, // Error FFI converter GenericException.ErrorHandler, ) - } - /** * Publish all unpublished messages */ @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `publishMessages`() { - return uniffiRustCallAsync( + override suspend fun `publishMessages`() = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_publish_messages( thisPtr, - - ) - }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation ) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, // lift function { Unit }, - // Error FFI converter GenericException.ErrorHandler, ) - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `removeAdmin`(`inboxId`: kotlin.String) { - return uniffiRustCallAsync( + override suspend fun `removeAdmin`(`inboxId`: kotlin.String) = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_remove_admin( thisPtr, FfiConverterString.lower(`inboxId`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, // lift function { Unit }, - // Error FFI converter GenericException.ErrorHandler, ) - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `removeMembers`(`accountAddresses`: List) { - return uniffiRustCallAsync( + override suspend fun `removeMembers`(`accountAddresses`: List) = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_remove_members( thisPtr, FfiConverterSequenceString.lower(`accountAddresses`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, // lift function { Unit }, - // Error FFI converter GenericException.ErrorHandler, ) - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `removeMembersByInboxId`(`inboxIds`: List) { - return uniffiRustCallAsync( + override suspend fun `removeMembersByInboxId`(`inboxIds`: List) = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_remove_members_by_inbox_id( thisPtr, FfiConverterSequenceString.lower(`inboxIds`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, // lift function { Unit }, - // Error FFI converter GenericException.ErrorHandler, ) - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `removeSuperAdmin`(`inboxId`: kotlin.String) { - return uniffiRustCallAsync( + override suspend fun `removeSuperAdmin`(`inboxId`: kotlin.String) = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_remove_super_admin( thisPtr, FfiConverterString.lower(`inboxId`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, // lift function { Unit }, - // Error FFI converter GenericException.ErrorHandler, ) - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `send`(`contentBytes`: kotlin.ByteArray): kotlin.ByteArray { - return uniffiRustCallAsync( + override suspend fun `send`(`contentBytes`: kotlin.ByteArray): kotlin.ByteArray = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_send( thisPtr, FfiConverterByteArray.lower(`contentBytes`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_rust_buffer( + { future, callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_rust_buffer( - future, - continuation - ) + continuation, + -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_rust_buffer(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterByteArray.lift(it) }, // Error FFI converter GenericException.ErrorHandler, ) - } - /** * send a message without immediately publishing to the delivery service. */ - @Throws(GenericException::class) - override fun `sendOptimistic`(`contentBytes`: kotlin.ByteArray): kotlin.ByteArray { - return FfiConverterByteArray.lift( + @Throws( + GenericException::class, + ) + override fun `sendOptimistic`(`contentBytes`: kotlin.ByteArray): kotlin.ByteArray = + FfiConverterByteArray.lift( callWithPointer { uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_send_optimistic( - it, FfiConverterByteArray.lower(`contentBytes`), _status + it, + FfiConverterByteArray.lower(`contentBytes`), + _status, ) } - } + }, ) - } - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `stream`(`messageCallback`: FfiMessageCallback): FfiStreamCloser { - return uniffiRustCallAsync( + override suspend fun `stream`(`messageCallback`: FfiMessageCallback): FfiStreamCloser = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_stream( thisPtr, FfiConverterTypeFfiMessageCallback.lower(`messageCallback`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_pointer( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_pointer( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_pointer(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_pointer(future) }, // lift function { FfiConverterTypeFfiStreamCloser.lift(it) }, // Error FFI converter UniffiNullRustCallStatusErrorHandler, ) - } - - @Throws(GenericException::class) - override fun `superAdminList`(): List { - return FfiConverterSequenceString.lift( + @Throws( + GenericException::class, + ) + override fun `superAdminList`(): List = + FfiConverterSequenceString.lift( callWithPointer { uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_super_admin_list( - it, _status + it, + _status, ) } - } + }, ) - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `sync`() { - return uniffiRustCallAsync( + override suspend fun `sync`() = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_sync( - thisPtr, - - ) - }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation + thisPtr, ) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, // lift function { Unit }, - // Error FFI converter GenericException.ErrorHandler, ) - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `updateGroupDescription`(`groupDescription`: kotlin.String) { - return uniffiRustCallAsync( + override suspend fun `updateGroupDescription`(`groupDescription`: kotlin.String) = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_update_group_description( thisPtr, FfiConverterString.lower(`groupDescription`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, // lift function { Unit }, - // Error FFI converter GenericException.ErrorHandler, ) - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `updateGroupImageUrlSquare`(`groupImageUrlSquare`: kotlin.String) { - return uniffiRustCallAsync( + override suspend fun `updateGroupImageUrlSquare`(`groupImageUrlSquare`: kotlin.String) = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_update_group_image_url_square( thisPtr, FfiConverterString.lower(`groupImageUrlSquare`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, // lift function { Unit }, - // Error FFI converter GenericException.ErrorHandler, ) - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `updateGroupName`(`groupName`: kotlin.String) { - return uniffiRustCallAsync( + override suspend fun `updateGroupName`(`groupName`: kotlin.String) = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_update_group_name( thisPtr, FfiConverterString.lower(`groupName`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, // lift function { Unit }, - // Error FFI converter GenericException.ErrorHandler, ) - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `updateGroupPinnedFrameUrl`(`pinnedFrameUrl`: kotlin.String) { - return uniffiRustCallAsync( + override suspend fun `updateGroupPinnedFrameUrl`(`pinnedFrameUrl`: kotlin.String) = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_update_group_pinned_frame_url( thisPtr, FfiConverterString.lower(`pinnedFrameUrl`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, // lift function { Unit }, - // Error FFI converter GenericException.ErrorHandler, ) - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") override suspend fun `updatePermissionPolicy`( `permissionUpdateType`: FfiPermissionUpdateType, `permissionPolicyOption`: FfiPermissionPolicy, - `metadataField`: FfiMetadataField? - ) { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_update_permission_policy( - thisPtr, - FfiConverterTypeFfiPermissionUpdateType.lower(`permissionUpdateType`), - FfiConverterTypeFfiPermissionPolicy.lower(`permissionPolicyOption`), - FfiConverterOptionalTypeFfiMetadataField.lower(`metadataField`), - ) - }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation - ) - }, - { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, - // lift function - { Unit }, - - // Error FFI converter - GenericException.ErrorHandler, - ) - } - + `metadataField`: FfiMetadataField?, + ) = uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_update_permission_policy( + thisPtr, + FfiConverterTypeFfiPermissionUpdateType.lower(`permissionUpdateType`), + FfiConverterTypeFfiPermissionPolicy.lower(`permissionPolicyOption`), + FfiConverterOptionalTypeFfiMetadataField.lower(`metadataField`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, + // lift function + { Unit }, + // Error FFI converter + GenericException.ErrorHandler, + ) companion object - } public object FfiConverterTypeFfiGroup : FfiConverter { + override fun lower(value: FfiGroup): Pointer = value.uniffiClonePointer() - override fun lower(value: FfiGroup): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): FfiGroup { - return FfiGroup(value) - } + override fun lift(value: Pointer): FfiGroup = FfiGroup(value) override fun read(buf: ByteBuffer): FfiGroup { // The Rust code always writes pointers as 8 bytes, and will @@ -4051,14 +3746,16 @@ public object FfiConverterTypeFfiGroup : FfiConverter { override fun allocationSize(value: FfiGroup) = 8UL - override fun write(value: FfiGroup, buf: ByteBuffer) { + override fun write( + value: FfiGroup, + buf: ByteBuffer, + ) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) } } - // This template implements a class for working with a Rust struct via a Pointer/Arc // to the live Rust struct on the other side of the FFI. // @@ -4156,9 +3853,7 @@ public object FfiConverterTypeFfiGroup : FfiConverter { // [1] https://stackoverflow.com/questions/24376768/can-java-finalize-an-object-when-it-is-still-in-scope/24380219 // - public interface FfiGroupMetadataInterface { - fun `conversationType`(): kotlin.String fun `creatorInboxId`(): kotlin.String @@ -4166,8 +3861,10 @@ public interface FfiGroupMetadataInterface { companion object } -open class FfiGroupMetadata : Disposable, AutoCloseable, FfiGroupMetadataInterface { - +open class FfiGroupMetadata : + Disposable, + AutoCloseable, + FfiGroupMetadataInterface { constructor(pointer: Pointer) { this.pointer = pointer this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) @@ -4231,7 +3928,9 @@ open class FfiGroupMetadata : Disposable, AutoCloseable, FfiGroupMetadataInterfa // Use a static inner class instead of a closure so as not to accidentally // capture `this` as part of the cleanable's action. - private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { + private class UniffiCleanAction( + private val pointer: Pointer?, + ) : Runnable { override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> @@ -4241,51 +3940,42 @@ open class FfiGroupMetadata : Disposable, AutoCloseable, FfiGroupMetadataInterfa } } - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> + fun uniffiClonePointer(): Pointer = + uniffiRustCall { status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_clone_ffigroupmetadata(pointer!!, status) } - } - override fun `conversationType`(): kotlin.String { - return FfiConverterString.lift( + override fun `conversationType`(): kotlin.String = + FfiConverterString.lift( callWithPointer { - uniffiRustCall() { _status -> + uniffiRustCall { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroupmetadata_conversation_type( - it, _status + it, + _status, ) } - } + }, ) - } - - override fun `creatorInboxId`(): kotlin.String { - return FfiConverterString.lift( + override fun `creatorInboxId`(): kotlin.String = + FfiConverterString.lift( callWithPointer { - uniffiRustCall() { _status -> + uniffiRustCall { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroupmetadata_creator_inbox_id( - it, _status + it, + _status, ) } - } + }, ) - } - companion object - } public object FfiConverterTypeFfiGroupMetadata : FfiConverter { + override fun lower(value: FfiGroupMetadata): Pointer = value.uniffiClonePointer() - override fun lower(value: FfiGroupMetadata): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): FfiGroupMetadata { - return FfiGroupMetadata(value) - } + override fun lift(value: Pointer): FfiGroupMetadata = FfiGroupMetadata(value) override fun read(buf: ByteBuffer): FfiGroupMetadata { // The Rust code always writes pointers as 8 bytes, and will @@ -4295,14 +3985,16 @@ public object FfiConverterTypeFfiGroupMetadata : FfiConverter // to the live Rust struct on the other side of the FFI. // @@ -4400,9 +4092,7 @@ public object FfiConverterTypeFfiGroupMetadata : FfiConverter uniffiRustCall { status -> @@ -4485,54 +4179,48 @@ open class FfiGroupPermissions : Disposable, AutoCloseable, FfiGroupPermissionsI } } - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> + fun uniffiClonePointer(): Pointer = + uniffiRustCall { status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_clone_ffigrouppermissions(pointer!!, status) } - } - - @Throws(GenericException::class) - override fun `policySet`(): FfiPermissionPolicySet { - return FfiConverterTypeFfiPermissionPolicySet.lift( + @Throws( + GenericException::class, + ) + override fun `policySet`(): FfiPermissionPolicySet = + FfiConverterTypeFfiPermissionPolicySet.lift( callWithPointer { uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigrouppermissions_policy_set( - it, _status + it, + _status, ) } - } + }, ) - } - - @Throws(GenericException::class) - override fun `policyType`(): FfiGroupPermissionsOptions { - return FfiConverterTypeFfiGroupPermissionsOptions.lift( + @Throws( + GenericException::class, + ) + override fun `policyType`(): FfiGroupPermissionsOptions = + FfiConverterTypeFfiGroupPermissionsOptions.lift( callWithPointer { uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigrouppermissions_policy_type( - it, _status + it, + _status, ) } - } + }, ) - } - companion object - } public object FfiConverterTypeFfiGroupPermissions : FfiConverter { + override fun lower(value: FfiGroupPermissions): Pointer = value.uniffiClonePointer() - override fun lower(value: FfiGroupPermissions): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): FfiGroupPermissions { - return FfiGroupPermissions(value) - } + override fun lift(value: Pointer): FfiGroupPermissions = FfiGroupPermissions(value) override fun read(buf: ByteBuffer): FfiGroupPermissions { // The Rust code always writes pointers as 8 bytes, and will @@ -4542,14 +4230,16 @@ public object FfiConverterTypeFfiGroupPermissions : FfiConverter // to the live Rust struct on the other side of the FFI. // @@ -4647,15 +4337,13 @@ public object FfiConverterTypeFfiGroupPermissions : FfiConverter uniffiRustCall { status -> @@ -4745,196 +4437,129 @@ open class FfiSignatureRequest : Disposable, AutoCloseable, FfiSignatureRequestI } } - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> + fun uniffiClonePointer(): Pointer = + uniffiRustCall { status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_clone_ffisignaturerequest(pointer!!, status) } - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `addEcdsaSignature`(`signatureBytes`: kotlin.ByteArray) { - return uniffiRustCallAsync( + override suspend fun `addEcdsaSignature`(`signatureBytes`: kotlin.ByteArray) = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffisignaturerequest_add_ecdsa_signature( thisPtr, FfiConverterByteArray.lower(`signatureBytes`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, // lift function { Unit }, - // Error FFI converter GenericException.ErrorHandler, ) - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") override suspend fun `addScwSignature`( `signatureBytes`: kotlin.ByteArray, `address`: kotlin.String, - `chainRpcUrl`: kotlin.String - ) { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffisignaturerequest_add_scw_signature( - thisPtr, - FfiConverterByteArray.lower(`signatureBytes`), - FfiConverterString.lower(`address`), - FfiConverterString.lower(`chainRpcUrl`), - ) - }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation - ) - }, - { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, - // lift function - { Unit }, - - // Error FFI converter - GenericException.ErrorHandler, - ) - } - + `chainRpcUrl`: kotlin.String, + ) = uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffisignaturerequest_add_scw_signature( + thisPtr, + FfiConverterByteArray.lower(`signatureBytes`), + FfiConverterString.lower(`address`), + FfiConverterString.lower(`chainRpcUrl`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, + // lift function + { Unit }, + // Error FFI converter + GenericException.ErrorHandler, + ) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `isReady`(): kotlin.Boolean { - return uniffiRustCallAsync( + override suspend fun `isReady`(): kotlin.Boolean = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffisignaturerequest_is_ready( thisPtr, - - ) - }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_i8( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_i8( - future, - continuation ) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_i8(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_i8(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_i8(future) }, // lift function { FfiConverterBoolean.lift(it) }, // Error FFI converter UniffiNullRustCallStatusErrorHandler, ) - } - /** * missing signatures that are from [MemberKind::Address] */ @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `missingAddressSignatures`(): List { - return uniffiRustCallAsync( + override suspend fun `missingAddressSignatures`(): List = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffisignaturerequest_missing_address_signatures( thisPtr, - - ) - }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_rust_buffer( - future, - callback, - continuation ) }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_rust_buffer( + { future, - continuation - ) + callback, + continuation, + -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_rust_buffer(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterSequenceString.lift(it) }, // Error FFI converter GenericException.ErrorHandler, ) - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `signatureText`(): kotlin.String { - return uniffiRustCallAsync( + override suspend fun `signatureText`(): kotlin.String = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffisignaturerequest_signature_text( thisPtr, - - ) - }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_rust_buffer( - future, - callback, - continuation ) }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_rust_buffer( + { future, - continuation - ) + callback, + continuation, + -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_rust_buffer(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterString.lift(it) }, // Error FFI converter GenericException.ErrorHandler, ) - } - companion object - } public object FfiConverterTypeFfiSignatureRequest : FfiConverter { + override fun lower(value: FfiSignatureRequest): Pointer = value.uniffiClonePointer() - override fun lower(value: FfiSignatureRequest): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): FfiSignatureRequest { - return FfiSignatureRequest(value) - } + override fun lift(value: Pointer): FfiSignatureRequest = FfiSignatureRequest(value) override fun read(buf: ByteBuffer): FfiSignatureRequest { // The Rust code always writes pointers as 8 bytes, and will @@ -4944,14 +4569,16 @@ public object FfiConverterTypeFfiSignatureRequest : FfiConverter // to the live Rust struct on the other side of the FFI. // @@ -5049,9 +4676,7 @@ public object FfiConverterTypeFfiSignatureRequest : FfiConverter uniffiRustCall { status -> @@ -5143,12 +4772,10 @@ open class FfiStreamCloser : Disposable, AutoCloseable, FfiStreamCloserInterface } } - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> + fun uniffiClonePointer(): Pointer = + uniffiRustCall { status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_clone_ffistreamcloser(pointer!!, status) } - } - /** * Signal the stream to end @@ -5156,75 +4783,54 @@ open class FfiStreamCloser : Disposable, AutoCloseable, FfiStreamCloserInterface */ override fun `end`() = callWithPointer { - uniffiRustCall() { _status -> + uniffiRustCall { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffistreamcloser_end( - it, _status + it, + _status, ) } } - /** * End the stream and asyncronously wait for it to shutdown */ @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `endAndWait`() { - return uniffiRustCallAsync( + override suspend fun `endAndWait`() = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffistreamcloser_end_and_wait( thisPtr, - - ) - }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation ) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, // lift function { Unit }, - // Error FFI converter GenericException.ErrorHandler, ) - } - override fun `isClosed`(): kotlin.Boolean { - return FfiConverterBoolean.lift( + override fun `isClosed`(): kotlin.Boolean = + FfiConverterBoolean.lift( callWithPointer { - uniffiRustCall() { _status -> + uniffiRustCall { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffistreamcloser_is_closed( - it, _status + it, + _status, ) } - } + }, ) - } - companion object - } public object FfiConverterTypeFfiStreamCloser : FfiConverter { + override fun lower(value: FfiStreamCloser): Pointer = value.uniffiClonePointer() - override fun lower(value: FfiStreamCloser): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): FfiStreamCloser { - return FfiStreamCloser(value) - } + override fun lift(value: Pointer): FfiStreamCloser = FfiStreamCloser(value) override fun read(buf: ByteBuffer): FfiStreamCloser { // The Rust code always writes pointers as 8 bytes, and will @@ -5234,14 +4840,16 @@ public object FfiConverterTypeFfiStreamCloser : FfiConverter // to the live Rust struct on the other side of the FFI. // @@ -5339,12 +4947,13 @@ public object FfiConverterTypeFfiStreamCloser : FfiConverter uniffiRustCall { status -> @@ -5433,127 +5046,101 @@ open class FfiV2ApiClient : Disposable, AutoCloseable, FfiV2ApiClientInterface { } } - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> + fun uniffiClonePointer(): Pointer = + uniffiRustCall { status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_clone_ffiv2apiclient(pointer!!, status) } - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `batchQuery`(`req`: FfiV2BatchQueryRequest): FfiV2BatchQueryResponse { - return uniffiRustCallAsync( + override suspend fun `batchQuery`(`req`: FfiV2BatchQueryRequest): FfiV2BatchQueryResponse = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffiv2apiclient_batch_query( thisPtr, FfiConverterTypeFfiV2BatchQueryRequest.lower(`req`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_rust_buffer( + { future, callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_rust_buffer( - future, - continuation - ) + continuation, + -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_rust_buffer(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterTypeFfiV2BatchQueryResponse.lift(it) }, // Error FFI converter GenericException.ErrorHandler, ) - } - @Throws(GenericException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `publish`(`request`: FfiPublishRequest, `authToken`: kotlin.String) { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffiv2apiclient_publish( - thisPtr, - FfiConverterTypeFfiPublishRequest.lower(`request`), - FfiConverterString.lower(`authToken`), - ) - }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation - ) - }, - { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, - // lift function - { Unit }, - - // Error FFI converter - GenericException.ErrorHandler, - ) - } - + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `publish`( + `request`: FfiPublishRequest, + `authToken`: kotlin.String, + ) = uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffiv2apiclient_publish( + thisPtr, + FfiConverterTypeFfiPublishRequest.lower(`request`), + FfiConverterString.lower(`authToken`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, + // lift function + { Unit }, + // Error FFI converter + GenericException.ErrorHandler, + ) @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `query`(`request`: FfiV2QueryRequest): FfiV2QueryResponse { - return uniffiRustCallAsync( + override suspend fun `query`(`request`: FfiV2QueryRequest): FfiV2QueryResponse = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffiv2apiclient_query( thisPtr, FfiConverterTypeFfiV2QueryRequest.lower(`request`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_rust_buffer( + { future, callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_rust_buffer( - future, - continuation - ) + continuation, + -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_rust_buffer(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterTypeFfiV2QueryResponse.lift(it) }, // Error FFI converter GenericException.ErrorHandler, ) - } override fun `setAppVersion`(`version`: kotlin.String) = callWithPointer { - uniffiRustCall() { _status -> + uniffiRustCall { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffiv2apiclient_set_app_version( - it, FfiConverterString.lower(`version`), _status + it, + FfiConverterString.lower(`version`), + _status, ) } } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") override suspend fun `subscribe`( `request`: FfiV2SubscribeRequest, - `callback`: FfiV2SubscriptionCallback - ): FfiV2Subscription { - return uniffiRustCallAsync( + `callback`: FfiV2SubscriptionCallback, + ): FfiV2Subscription = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffiv2apiclient_subscribe( thisPtr, @@ -5561,41 +5148,22 @@ open class FfiV2ApiClient : Disposable, AutoCloseable, FfiV2ApiClientInterface { FfiConverterTypeFfiV2SubscriptionCallback.lower(`callback`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_pointer( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_pointer( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_pointer(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_pointer(future) }, // lift function { FfiConverterTypeFfiV2Subscription.lift(it) }, // Error FFI converter GenericException.ErrorHandler, ) - } - companion object - } public object FfiConverterTypeFfiV2ApiClient : FfiConverter { + override fun lower(value: FfiV2ApiClient): Pointer = value.uniffiClonePointer() - override fun lower(value: FfiV2ApiClient): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): FfiV2ApiClient { - return FfiV2ApiClient(value) - } + override fun lift(value: Pointer): FfiV2ApiClient = FfiV2ApiClient(value) override fun read(buf: ByteBuffer): FfiV2ApiClient { // The Rust code always writes pointers as 8 bytes, and will @@ -5605,14 +5173,16 @@ public object FfiConverterTypeFfiV2ApiClient : FfiConverter // to the live Rust struct on the other side of the FFI. // @@ -5710,12 +5280,10 @@ public object FfiConverterTypeFfiV2ApiClient : FfiConverter uniffiRustCall { status -> @@ -5814,12 +5386,10 @@ open class FfiV2Subscription : Disposable, AutoCloseable, FfiV2SubscriptionInter } } - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> + fun uniffiClonePointer(): Pointer = + uniffiRustCall { status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_clone_ffiv2subscription(pointer!!, status) } - } - /** * End the subscription, waiting for the subscription to close entirely. @@ -5828,102 +5398,66 @@ open class FfiV2Subscription : Disposable, AutoCloseable, FfiV2SubscriptionInter */ @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `end`() { - return uniffiRustCallAsync( + override suspend fun `end`() = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffiv2subscription_end( thisPtr, - - ) - }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation ) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, // lift function { Unit }, - // Error FFI converter GenericException.ErrorHandler, ) - } - /** * Check if the subscription is closed */ - override fun `isClosed`(): kotlin.Boolean { - return FfiConverterBoolean.lift( + override fun `isClosed`(): kotlin.Boolean = + FfiConverterBoolean.lift( callWithPointer { - uniffiRustCall() { _status -> + uniffiRustCall { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffiv2subscription_is_closed( - it, _status + it, + _status, ) } - } + }, ) - } - /** * Update subscription with new topics */ @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `update`(`req`: FfiV2SubscribeRequest) { - return uniffiRustCallAsync( + override suspend fun `update`(`req`: FfiV2SubscribeRequest) = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffiv2subscription_update( thisPtr, FfiConverterTypeFfiV2SubscribeRequest.lower(`req`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, // lift function { Unit }, - // Error FFI converter GenericException.ErrorHandler, ) - } - companion object - } public object FfiConverterTypeFfiV2Subscription : FfiConverter { + override fun lower(value: FfiV2Subscription): Pointer = value.uniffiClonePointer() - override fun lower(value: FfiV2Subscription): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): FfiV2Subscription { - return FfiV2Subscription(value) - } + override fun lift(value: Pointer): FfiV2Subscription = FfiV2Subscription(value) override fun read(buf: ByteBuffer): FfiV2Subscription { // The Rust code always writes pointers as 8 bytes, and will @@ -5933,14 +5467,16 @@ public object FfiConverterTypeFfiV2Subscription : FfiConverter // to the live Rust struct on the other side of the FFI. // @@ -6038,15 +5574,13 @@ public object FfiConverterTypeFfiV2Subscription : FfiConverter uniffiRustCall { status -> @@ -6158,12 +5696,10 @@ open class FfiXmtpClient : Disposable, AutoCloseable, FfiXmtpClientInterface { } } - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> + fun uniffiClonePointer(): Pointer = + uniffiRustCall { status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_clone_ffixmtpclient(pointer!!, status) } - } - /** * Adds an identity - really a wallet address - to the existing client @@ -6172,9 +5708,9 @@ open class FfiXmtpClient : Disposable, AutoCloseable, FfiXmtpClientInterface { @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") override suspend fun `addWallet`( `existingWalletAddress`: kotlin.String, - `newWalletAddress`: kotlin.String - ): FfiSignatureRequest { - return uniffiRustCallAsync( + `newWalletAddress`: kotlin.String, + ): FfiSignatureRequest = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffixmtpclient_add_wallet( thisPtr, @@ -6182,361 +5718,261 @@ open class FfiXmtpClient : Disposable, AutoCloseable, FfiXmtpClientInterface { FfiConverterString.lower(`newWalletAddress`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_pointer( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_pointer( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_pointer(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_pointer(future) }, // lift function { FfiConverterTypeFfiSignatureRequest.lift(it) }, // Error FFI converter GenericException.ErrorHandler, ) - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `applySignatureRequest`(`signatureRequest`: FfiSignatureRequest) { - return uniffiRustCallAsync( + override suspend fun `applySignatureRequest`(`signatureRequest`: FfiSignatureRequest) = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffixmtpclient_apply_signature_request( thisPtr, FfiConverterTypeFfiSignatureRequest.lower(`signatureRequest`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, // lift function { Unit }, - // Error FFI converter GenericException.ErrorHandler, ) - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `canMessage`(`accountAddresses`: List): Map { - return uniffiRustCallAsync( + override suspend fun `canMessage`(`accountAddresses`: List): Map = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffixmtpclient_can_message( thisPtr, FfiConverterSequenceString.lower(`accountAddresses`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_rust_buffer( + { future, callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_rust_buffer( - future, - continuation - ) + continuation, + -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_rust_buffer(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterMapStringBoolean.lift(it) }, // Error FFI converter GenericException.ErrorHandler, ) - } - override fun `conversations`(): FfiConversations { - return FfiConverterTypeFfiConversations.lift( + override fun `conversations`(): FfiConversations = + FfiConverterTypeFfiConversations.lift( callWithPointer { - uniffiRustCall() { _status -> + uniffiRustCall { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffixmtpclient_conversations( - it, _status + it, + _status, ) } - } + }, ) - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `dbReconnect`() { - return uniffiRustCallAsync( + override suspend fun `dbReconnect`() = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffixmtpclient_db_reconnect( thisPtr, - - ) - }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation ) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, // lift function { Unit }, - // Error FFI converter GenericException.ErrorHandler, ) - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `findInboxId`(`address`: kotlin.String): kotlin.String? { - return uniffiRustCallAsync( + override suspend fun `findInboxId`(`address`: kotlin.String): kotlin.String? = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffixmtpclient_find_inbox_id( thisPtr, FfiConverterString.lower(`address`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_rust_buffer( + { future, callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_rust_buffer( - future, - continuation - ) + continuation, + -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_rust_buffer(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterOptionalString.lift(it) }, // Error FFI converter GenericException.ErrorHandler, ) - } - - @Throws(GenericException::class) - override fun `group`(`groupId`: kotlin.ByteArray): FfiGroup { - return FfiConverterTypeFfiGroup.lift( + @Throws( + GenericException::class, + ) + override fun `group`(`groupId`: kotlin.ByteArray): FfiGroup = + FfiConverterTypeFfiGroup.lift( callWithPointer { uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffixmtpclient_group( - it, FfiConverterByteArray.lower(`groupId`), _status + it, + FfiConverterByteArray.lower(`groupId`), + _status, ) } - } + }, ) - } - - override fun `inboxId`(): kotlin.String { - return FfiConverterString.lift( + override fun `inboxId`(): kotlin.String = + FfiConverterString.lift( callWithPointer { - uniffiRustCall() { _status -> + uniffiRustCall { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffixmtpclient_inbox_id( - it, _status + it, + _status, ) } - } + }, ) - } - - override fun `installationId`(): kotlin.ByteArray { - return FfiConverterByteArray.lift( + override fun `installationId`(): kotlin.ByteArray = + FfiConverterByteArray.lift( callWithPointer { - uniffiRustCall() { _status -> + uniffiRustCall { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffixmtpclient_installation_id( - it, _status + it, + _status, ) } - } + }, ) - } - - @Throws(GenericException::class) - override fun `message`(`messageId`: kotlin.ByteArray): FfiMessage { - return FfiConverterTypeFfiMessage.lift( + @Throws( + GenericException::class, + ) + override fun `message`(`messageId`: kotlin.ByteArray): FfiMessage = + FfiConverterTypeFfiMessage.lift( callWithPointer { uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffixmtpclient_message( - it, FfiConverterByteArray.lower(`messageId`), _status + it, + FfiConverterByteArray.lower(`messageId`), + _status, ) } - } + }, ) - } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `registerIdentity`(`signatureRequest`: FfiSignatureRequest) { - return uniffiRustCallAsync( + override suspend fun `registerIdentity`(`signatureRequest`: FfiSignatureRequest) = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffixmtpclient_register_identity( thisPtr, FfiConverterTypeFfiSignatureRequest.lower(`signatureRequest`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, // lift function { Unit }, - // Error FFI converter GenericException.ErrorHandler, ) - } - - @Throws(GenericException::class) + @Throws( + GenericException::class, + ) override fun `releaseDbConnection`() = callWithPointer { uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffixmtpclient_release_db_connection( - it, _status + it, + _status, ) } } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `requestHistorySync`() { - return uniffiRustCallAsync( + override suspend fun `requestHistorySync`() = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffixmtpclient_request_history_sync( thisPtr, - - ) - }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( - future, - continuation ) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, // lift function { Unit }, - // Error FFI converter GenericException.ErrorHandler, ) - } - /** * Revokes or removes an identity - really a wallet address - from the existing client */ @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `revokeWallet`(`walletAddress`: kotlin.String): FfiSignatureRequest { - return uniffiRustCallAsync( + override suspend fun `revokeWallet`(`walletAddress`: kotlin.String): FfiSignatureRequest = + uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffixmtpclient_revoke_wallet( thisPtr, FfiConverterString.lower(`walletAddress`), ) }, - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_pointer( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_pointer( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_pointer(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_pointer(future) }, // lift function { FfiConverterTypeFfiSignatureRequest.lift(it) }, // Error FFI converter GenericException.ErrorHandler, ) - } - override fun `signatureRequest`(): FfiSignatureRequest? { - return FfiConverterOptionalTypeFfiSignatureRequest.lift( + override fun `signatureRequest`(): FfiSignatureRequest? = + FfiConverterOptionalTypeFfiSignatureRequest.lift( callWithPointer { - uniffiRustCall() { _status -> + uniffiRustCall { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffixmtpclient_signature_request( - it, _status + it, + _status, ) } - } + }, ) - } - companion object - } public object FfiConverterTypeFfiXmtpClient : FfiConverter { + override fun lower(value: FfiXmtpClient): Pointer = value.uniffiClonePointer() - override fun lower(value: FfiXmtpClient): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): FfiXmtpClient { - return FfiXmtpClient(value) - } + override fun lift(value: Pointer): FfiXmtpClient = FfiXmtpClient(value) override fun read(buf: ByteBuffer): FfiXmtpClient { // The Rust code always writes pointers as 8 bytes, and will @@ -6546,30 +5982,30 @@ public object FfiConverterTypeFfiXmtpClient : FfiConverter { - override fun read(buf: ByteBuffer): FfiCreateGroupOptions { - return FfiCreateGroupOptions( +public object FfiConverterTypeFfiCreateGroupOptions : FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): FfiCreateGroupOptions = + FfiCreateGroupOptions( FfiConverterOptionalTypeFfiGroupPermissionsOptions.read(buf), FfiConverterOptionalString.read(buf), FfiConverterOptionalString.read(buf), @@ -6577,18 +6013,21 @@ public object FfiConverterTypeFfiCreateGroupOptions : FfiConverterOptionalString.read(buf), FfiConverterOptionalTypeFfiPermissionPolicySet.read(buf), ) - } - override fun allocationSize(value: FfiCreateGroupOptions) = ( + override fun allocationSize(value: FfiCreateGroupOptions) = + ( FfiConverterOptionalTypeFfiGroupPermissionsOptions.allocationSize(value.`permissions`) + - FfiConverterOptionalString.allocationSize(value.`groupName`) + - FfiConverterOptionalString.allocationSize(value.`groupImageUrlSquare`) + - FfiConverterOptionalString.allocationSize(value.`groupDescription`) + - FfiConverterOptionalString.allocationSize(value.`groupPinnedFrameUrl`) + - FfiConverterOptionalTypeFfiPermissionPolicySet.allocationSize(value.`customPermissionPolicySet`) - ) + FfiConverterOptionalString.allocationSize(value.`groupName`) + + FfiConverterOptionalString.allocationSize(value.`groupImageUrlSquare`) + + FfiConverterOptionalString.allocationSize(value.`groupDescription`) + + FfiConverterOptionalString.allocationSize(value.`groupPinnedFrameUrl`) + + FfiConverterOptionalTypeFfiPermissionPolicySet.allocationSize(value.`customPermissionPolicySet`) + ) - override fun write(value: FfiCreateGroupOptions, buf: ByteBuffer) { + override fun write( + value: FfiCreateGroupOptions, + buf: ByteBuffer, + ) { FfiConverterOptionalTypeFfiGroupPermissionsOptions.write(value.`permissions`, buf) FfiConverterOptionalString.write(value.`groupName`, buf) FfiConverterOptionalString.write(value.`groupImageUrlSquare`, buf) @@ -6598,95 +6037,98 @@ public object FfiConverterTypeFfiCreateGroupOptions : } } - data class FfiCursor( var `digest`: kotlin.ByteArray, - var `senderTimeNs`: kotlin.ULong + var `senderTimeNs`: kotlin.ULong, ) { - companion object } public object FfiConverterTypeFfiCursor : FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): FfiCursor { - return FfiCursor( + override fun read(buf: ByteBuffer): FfiCursor = + FfiCursor( FfiConverterByteArray.read(buf), FfiConverterULong.read(buf), ) - } - override fun allocationSize(value: FfiCursor) = ( + override fun allocationSize(value: FfiCursor) = + ( FfiConverterByteArray.allocationSize(value.`digest`) + - FfiConverterULong.allocationSize(value.`senderTimeNs`) - ) + FfiConverterULong.allocationSize(value.`senderTimeNs`) + ) - override fun write(value: FfiCursor, buf: ByteBuffer) { + override fun write( + value: FfiCursor, + buf: ByteBuffer, + ) { FfiConverterByteArray.write(value.`digest`, buf) FfiConverterULong.write(value.`senderTimeNs`, buf) } } - data class FfiEnvelope( var `contentTopic`: kotlin.String, var `timestampNs`: kotlin.ULong, - var `message`: kotlin.ByteArray + var `message`: kotlin.ByteArray, ) { - companion object } public object FfiConverterTypeFfiEnvelope : FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): FfiEnvelope { - return FfiEnvelope( + override fun read(buf: ByteBuffer): FfiEnvelope = + FfiEnvelope( FfiConverterString.read(buf), FfiConverterULong.read(buf), FfiConverterByteArray.read(buf), ) - } - override fun allocationSize(value: FfiEnvelope) = ( + override fun allocationSize(value: FfiEnvelope) = + ( FfiConverterString.allocationSize(value.`contentTopic`) + - FfiConverterULong.allocationSize(value.`timestampNs`) + - FfiConverterByteArray.allocationSize(value.`message`) - ) + FfiConverterULong.allocationSize(value.`timestampNs`) + + FfiConverterByteArray.allocationSize(value.`message`) + ) - override fun write(value: FfiEnvelope, buf: ByteBuffer) { + override fun write( + value: FfiEnvelope, + buf: ByteBuffer, + ) { FfiConverterString.write(value.`contentTopic`, buf) FfiConverterULong.write(value.`timestampNs`, buf) FfiConverterByteArray.write(value.`message`, buf) } } - data class FfiGroupMember( var `inboxId`: kotlin.String, var `accountAddresses`: List, var `installationIds`: List, - var `permissionLevel`: FfiPermissionLevel + var `permissionLevel`: FfiPermissionLevel, ) { - companion object } public object FfiConverterTypeFfiGroupMember : FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): FfiGroupMember { - return FfiGroupMember( + override fun read(buf: ByteBuffer): FfiGroupMember = + FfiGroupMember( FfiConverterString.read(buf), FfiConverterSequenceString.read(buf), FfiConverterSequenceByteArray.read(buf), FfiConverterTypeFfiPermissionLevel.read(buf), ) - } - override fun allocationSize(value: FfiGroupMember) = ( + override fun allocationSize(value: FfiGroupMember) = + ( FfiConverterString.allocationSize(value.`inboxId`) + - FfiConverterSequenceString.allocationSize(value.`accountAddresses`) + - FfiConverterSequenceByteArray.allocationSize(value.`installationIds`) + - FfiConverterTypeFfiPermissionLevel.allocationSize(value.`permissionLevel`) - ) + FfiConverterSequenceString.allocationSize(value.`accountAddresses`) + + FfiConverterSequenceByteArray.allocationSize(value.`installationIds`) + + FfiConverterTypeFfiPermissionLevel.allocationSize(value.`permissionLevel`) + ) - override fun write(value: FfiGroupMember, buf: ByteBuffer) { + override fun write( + value: FfiGroupMember, + buf: ByteBuffer, + ) { FfiConverterString.write(value.`inboxId`, buf) FfiConverterSequenceString.write(value.`accountAddresses`, buf) FfiConverterSequenceByteArray.write(value.`installationIds`, buf) @@ -6694,69 +6136,69 @@ public object FfiConverterTypeFfiGroupMember : FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): FfiListConversationsOptions { - return FfiListConversationsOptions( +public object FfiConverterTypeFfiListConversationsOptions : FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): FfiListConversationsOptions = + FfiListConversationsOptions( FfiConverterOptionalLong.read(buf), FfiConverterOptionalLong.read(buf), FfiConverterOptionalLong.read(buf), ) - } - override fun allocationSize(value: FfiListConversationsOptions) = ( + override fun allocationSize(value: FfiListConversationsOptions) = + ( FfiConverterOptionalLong.allocationSize(value.`createdAfterNs`) + - FfiConverterOptionalLong.allocationSize(value.`createdBeforeNs`) + - FfiConverterOptionalLong.allocationSize(value.`limit`) - ) + FfiConverterOptionalLong.allocationSize(value.`createdBeforeNs`) + + FfiConverterOptionalLong.allocationSize(value.`limit`) + ) - override fun write(value: FfiListConversationsOptions, buf: ByteBuffer) { + override fun write( + value: FfiListConversationsOptions, + buf: ByteBuffer, + ) { FfiConverterOptionalLong.write(value.`createdAfterNs`, buf) FfiConverterOptionalLong.write(value.`createdBeforeNs`, buf) FfiConverterOptionalLong.write(value.`limit`, buf) } } - data class FfiListMessagesOptions( var `sentBeforeNs`: kotlin.Long?, var `sentAfterNs`: kotlin.Long?, var `limit`: kotlin.Long?, - var `deliveryStatus`: FfiDeliveryStatus? + var `deliveryStatus`: FfiDeliveryStatus?, ) { - companion object } -public object FfiConverterTypeFfiListMessagesOptions : - FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): FfiListMessagesOptions { - return FfiListMessagesOptions( +public object FfiConverterTypeFfiListMessagesOptions : FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): FfiListMessagesOptions = + FfiListMessagesOptions( FfiConverterOptionalLong.read(buf), FfiConverterOptionalLong.read(buf), FfiConverterOptionalLong.read(buf), FfiConverterOptionalTypeFfiDeliveryStatus.read(buf), ) - } - override fun allocationSize(value: FfiListMessagesOptions) = ( + override fun allocationSize(value: FfiListMessagesOptions) = + ( FfiConverterOptionalLong.allocationSize(value.`sentBeforeNs`) + - FfiConverterOptionalLong.allocationSize(value.`sentAfterNs`) + - FfiConverterOptionalLong.allocationSize(value.`limit`) + - FfiConverterOptionalTypeFfiDeliveryStatus.allocationSize(value.`deliveryStatus`) - ) + FfiConverterOptionalLong.allocationSize(value.`sentAfterNs`) + + FfiConverterOptionalLong.allocationSize(value.`limit`) + + FfiConverterOptionalTypeFfiDeliveryStatus.allocationSize(value.`deliveryStatus`) + ) - override fun write(value: FfiListMessagesOptions, buf: ByteBuffer) { + override fun write( + value: FfiListMessagesOptions, + buf: ByteBuffer, + ) { FfiConverterOptionalLong.write(value.`sentBeforeNs`, buf) FfiConverterOptionalLong.write(value.`sentAfterNs`, buf) FfiConverterOptionalLong.write(value.`limit`, buf) @@ -6764,7 +6206,6 @@ public object FfiConverterTypeFfiListMessagesOptions : } } - data class FfiMessage( var `id`: kotlin.ByteArray, var `sentAtNs`: kotlin.Long, @@ -6772,15 +6213,14 @@ data class FfiMessage( var `senderInboxId`: kotlin.String, var `content`: kotlin.ByteArray, var `kind`: FfiGroupMessageKind, - var `deliveryStatus`: FfiDeliveryStatus + var `deliveryStatus`: FfiDeliveryStatus, ) { - companion object } public object FfiConverterTypeFfiMessage : FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): FfiMessage { - return FfiMessage( + override fun read(buf: ByteBuffer): FfiMessage = + FfiMessage( FfiConverterByteArray.read(buf), FfiConverterLong.read(buf), FfiConverterByteArray.read(buf), @@ -6789,19 +6229,22 @@ public object FfiConverterTypeFfiMessage : FfiConverterRustBuffer { FfiConverterTypeFfiGroupMessageKind.read(buf), FfiConverterTypeFfiDeliveryStatus.read(buf), ) - } - override fun allocationSize(value: FfiMessage) = ( + override fun allocationSize(value: FfiMessage) = + ( FfiConverterByteArray.allocationSize(value.`id`) + - FfiConverterLong.allocationSize(value.`sentAtNs`) + - FfiConverterByteArray.allocationSize(value.`convoId`) + - FfiConverterString.allocationSize(value.`senderInboxId`) + - FfiConverterByteArray.allocationSize(value.`content`) + - FfiConverterTypeFfiGroupMessageKind.allocationSize(value.`kind`) + - FfiConverterTypeFfiDeliveryStatus.allocationSize(value.`deliveryStatus`) - ) + FfiConverterLong.allocationSize(value.`sentAtNs`) + + FfiConverterByteArray.allocationSize(value.`convoId`) + + FfiConverterString.allocationSize(value.`senderInboxId`) + + FfiConverterByteArray.allocationSize(value.`content`) + + FfiConverterTypeFfiGroupMessageKind.allocationSize(value.`kind`) + + FfiConverterTypeFfiDeliveryStatus.allocationSize(value.`deliveryStatus`) + ) - override fun write(value: FfiMessage, buf: ByteBuffer) { + override fun write( + value: FfiMessage, + buf: ByteBuffer, + ) { FfiConverterByteArray.write(value.`id`, buf) FfiConverterLong.write(value.`sentAtNs`, buf) FfiConverterByteArray.write(value.`convoId`, buf) @@ -6812,39 +6255,39 @@ public object FfiConverterTypeFfiMessage : FfiConverterRustBuffer { } } - data class FfiPagingInfo( var `limit`: kotlin.UInt, var `cursor`: FfiCursor?, - var `direction`: FfiSortDirection + var `direction`: FfiSortDirection, ) { - companion object } public object FfiConverterTypeFfiPagingInfo : FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): FfiPagingInfo { - return FfiPagingInfo( + override fun read(buf: ByteBuffer): FfiPagingInfo = + FfiPagingInfo( FfiConverterUInt.read(buf), FfiConverterOptionalTypeFfiCursor.read(buf), FfiConverterTypeFfiSortDirection.read(buf), ) - } - override fun allocationSize(value: FfiPagingInfo) = ( + override fun allocationSize(value: FfiPagingInfo) = + ( FfiConverterUInt.allocationSize(value.`limit`) + - FfiConverterOptionalTypeFfiCursor.allocationSize(value.`cursor`) + - FfiConverterTypeFfiSortDirection.allocationSize(value.`direction`) - ) + FfiConverterOptionalTypeFfiCursor.allocationSize(value.`cursor`) + + FfiConverterTypeFfiSortDirection.allocationSize(value.`direction`) + ) - override fun write(value: FfiPagingInfo, buf: ByteBuffer) { + override fun write( + value: FfiPagingInfo, + buf: ByteBuffer, + ) { FfiConverterUInt.write(value.`limit`, buf) FfiConverterOptionalTypeFfiCursor.write(value.`cursor`, buf) FfiConverterTypeFfiSortDirection.write(value.`direction`, buf) } } - data class FfiPermissionPolicySet( var `addMemberPolicy`: FfiPermissionPolicy, var `removeMemberPolicy`: FfiPermissionPolicy, @@ -6853,16 +6296,14 @@ data class FfiPermissionPolicySet( var `updateGroupNamePolicy`: FfiPermissionPolicy, var `updateGroupDescriptionPolicy`: FfiPermissionPolicy, var `updateGroupImageUrlSquarePolicy`: FfiPermissionPolicy, - var `updateGroupPinnedFrameUrlPolicy`: FfiPermissionPolicy + var `updateGroupPinnedFrameUrlPolicy`: FfiPermissionPolicy, ) { - companion object } -public object FfiConverterTypeFfiPermissionPolicySet : - FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): FfiPermissionPolicySet { - return FfiPermissionPolicySet( +public object FfiConverterTypeFfiPermissionPolicySet : FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): FfiPermissionPolicySet = + FfiPermissionPolicySet( FfiConverterTypeFfiPermissionPolicy.read(buf), FfiConverterTypeFfiPermissionPolicy.read(buf), FfiConverterTypeFfiPermissionPolicy.read(buf), @@ -6872,20 +6313,23 @@ public object FfiConverterTypeFfiPermissionPolicySet : FfiConverterTypeFfiPermissionPolicy.read(buf), FfiConverterTypeFfiPermissionPolicy.read(buf), ) - } - override fun allocationSize(value: FfiPermissionPolicySet) = ( + override fun allocationSize(value: FfiPermissionPolicySet) = + ( FfiConverterTypeFfiPermissionPolicy.allocationSize(value.`addMemberPolicy`) + - FfiConverterTypeFfiPermissionPolicy.allocationSize(value.`removeMemberPolicy`) + - FfiConverterTypeFfiPermissionPolicy.allocationSize(value.`addAdminPolicy`) + - FfiConverterTypeFfiPermissionPolicy.allocationSize(value.`removeAdminPolicy`) + - FfiConverterTypeFfiPermissionPolicy.allocationSize(value.`updateGroupNamePolicy`) + - FfiConverterTypeFfiPermissionPolicy.allocationSize(value.`updateGroupDescriptionPolicy`) + - FfiConverterTypeFfiPermissionPolicy.allocationSize(value.`updateGroupImageUrlSquarePolicy`) + - FfiConverterTypeFfiPermissionPolicy.allocationSize(value.`updateGroupPinnedFrameUrlPolicy`) - ) + FfiConverterTypeFfiPermissionPolicy.allocationSize(value.`removeMemberPolicy`) + + FfiConverterTypeFfiPermissionPolicy.allocationSize(value.`addAdminPolicy`) + + FfiConverterTypeFfiPermissionPolicy.allocationSize(value.`removeAdminPolicy`) + + FfiConverterTypeFfiPermissionPolicy.allocationSize(value.`updateGroupNamePolicy`) + + FfiConverterTypeFfiPermissionPolicy.allocationSize(value.`updateGroupDescriptionPolicy`) + + FfiConverterTypeFfiPermissionPolicy.allocationSize(value.`updateGroupImageUrlSquarePolicy`) + + FfiConverterTypeFfiPermissionPolicy.allocationSize(value.`updateGroupPinnedFrameUrlPolicy`) + ) - override fun write(value: FfiPermissionPolicySet, buf: ByteBuffer) { + override fun write( + value: FfiPermissionPolicySet, + buf: ByteBuffer, + ) { FfiConverterTypeFfiPermissionPolicy.write(value.`addMemberPolicy`, buf) FfiConverterTypeFfiPermissionPolicy.write(value.`removeMemberPolicy`, buf) FfiConverterTypeFfiPermissionPolicy.write(value.`addAdminPolicy`, buf) @@ -6897,109 +6341,111 @@ public object FfiConverterTypeFfiPermissionPolicySet : } } - data class FfiPublishRequest( - var `envelopes`: List + var `envelopes`: List, ) { - companion object } public object FfiConverterTypeFfiPublishRequest : FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): FfiPublishRequest { - return FfiPublishRequest( + override fun read(buf: ByteBuffer): FfiPublishRequest = + FfiPublishRequest( FfiConverterSequenceTypeFfiEnvelope.read(buf), ) - } - override fun allocationSize(value: FfiPublishRequest) = ( + override fun allocationSize(value: FfiPublishRequest) = + ( FfiConverterSequenceTypeFfiEnvelope.allocationSize(value.`envelopes`) - ) + ) - override fun write(value: FfiPublishRequest, buf: ByteBuffer) { + override fun write( + value: FfiPublishRequest, + buf: ByteBuffer, + ) { FfiConverterSequenceTypeFfiEnvelope.write(value.`envelopes`, buf) } } - data class FfiV2BatchQueryRequest( - var `requests`: List + var `requests`: List, ) { - companion object } -public object FfiConverterTypeFfiV2BatchQueryRequest : - FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): FfiV2BatchQueryRequest { - return FfiV2BatchQueryRequest( +public object FfiConverterTypeFfiV2BatchQueryRequest : FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): FfiV2BatchQueryRequest = + FfiV2BatchQueryRequest( FfiConverterSequenceTypeFfiV2QueryRequest.read(buf), ) - } - override fun allocationSize(value: FfiV2BatchQueryRequest) = ( + override fun allocationSize(value: FfiV2BatchQueryRequest) = + ( FfiConverterSequenceTypeFfiV2QueryRequest.allocationSize(value.`requests`) - ) + ) - override fun write(value: FfiV2BatchQueryRequest, buf: ByteBuffer) { + override fun write( + value: FfiV2BatchQueryRequest, + buf: ByteBuffer, + ) { FfiConverterSequenceTypeFfiV2QueryRequest.write(value.`requests`, buf) } } - data class FfiV2BatchQueryResponse( - var `responses`: List + var `responses`: List, ) { - companion object } -public object FfiConverterTypeFfiV2BatchQueryResponse : - FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): FfiV2BatchQueryResponse { - return FfiV2BatchQueryResponse( +public object FfiConverterTypeFfiV2BatchQueryResponse : FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): FfiV2BatchQueryResponse = + FfiV2BatchQueryResponse( FfiConverterSequenceTypeFfiV2QueryResponse.read(buf), ) - } - override fun allocationSize(value: FfiV2BatchQueryResponse) = ( + override fun allocationSize(value: FfiV2BatchQueryResponse) = + ( FfiConverterSequenceTypeFfiV2QueryResponse.allocationSize(value.`responses`) - ) + ) - override fun write(value: FfiV2BatchQueryResponse, buf: ByteBuffer) { + override fun write( + value: FfiV2BatchQueryResponse, + buf: ByteBuffer, + ) { FfiConverterSequenceTypeFfiV2QueryResponse.write(value.`responses`, buf) } } - data class FfiV2QueryRequest( var `contentTopics`: List, var `startTimeNs`: kotlin.ULong, var `endTimeNs`: kotlin.ULong, - var `pagingInfo`: FfiPagingInfo? + var `pagingInfo`: FfiPagingInfo?, ) { - companion object } public object FfiConverterTypeFfiV2QueryRequest : FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): FfiV2QueryRequest { - return FfiV2QueryRequest( + override fun read(buf: ByteBuffer): FfiV2QueryRequest = + FfiV2QueryRequest( FfiConverterSequenceString.read(buf), FfiConverterULong.read(buf), FfiConverterULong.read(buf), FfiConverterOptionalTypeFfiPagingInfo.read(buf), ) - } - override fun allocationSize(value: FfiV2QueryRequest) = ( + override fun allocationSize(value: FfiV2QueryRequest) = + ( FfiConverterSequenceString.allocationSize(value.`contentTopics`) + - FfiConverterULong.allocationSize(value.`startTimeNs`) + - FfiConverterULong.allocationSize(value.`endTimeNs`) + - FfiConverterOptionalTypeFfiPagingInfo.allocationSize(value.`pagingInfo`) - ) + FfiConverterULong.allocationSize(value.`startTimeNs`) + + FfiConverterULong.allocationSize(value.`endTimeNs`) + + FfiConverterOptionalTypeFfiPagingInfo.allocationSize(value.`pagingInfo`) + ) - override fun write(value: FfiV2QueryRequest, buf: ByteBuffer) { + override fun write( + value: FfiV2QueryRequest, + buf: ByteBuffer, + ) { FfiConverterSequenceString.write(value.`contentTopics`, buf) FfiConverterULong.write(value.`startTimeNs`, buf) FfiConverterULong.write(value.`endTimeNs`, buf) @@ -7007,302 +6453,336 @@ public object FfiConverterTypeFfiV2QueryRequest : FfiConverterRustBuffer, - var `pagingInfo`: FfiPagingInfo? + var `pagingInfo`: FfiPagingInfo?, ) { - companion object } public object FfiConverterTypeFfiV2QueryResponse : FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): FfiV2QueryResponse { - return FfiV2QueryResponse( + override fun read(buf: ByteBuffer): FfiV2QueryResponse = + FfiV2QueryResponse( FfiConverterSequenceTypeFfiEnvelope.read(buf), FfiConverterOptionalTypeFfiPagingInfo.read(buf), ) - } - override fun allocationSize(value: FfiV2QueryResponse) = ( + override fun allocationSize(value: FfiV2QueryResponse) = + ( FfiConverterSequenceTypeFfiEnvelope.allocationSize(value.`envelopes`) + - FfiConverterOptionalTypeFfiPagingInfo.allocationSize(value.`pagingInfo`) - ) + FfiConverterOptionalTypeFfiPagingInfo.allocationSize(value.`pagingInfo`) + ) - override fun write(value: FfiV2QueryResponse, buf: ByteBuffer) { + override fun write( + value: FfiV2QueryResponse, + buf: ByteBuffer, + ) { FfiConverterSequenceTypeFfiEnvelope.write(value.`envelopes`, buf) FfiConverterOptionalTypeFfiPagingInfo.write(value.`pagingInfo`, buf) } } - data class FfiV2SubscribeRequest( - var `contentTopics`: List + var `contentTopics`: List, ) { - companion object } -public object FfiConverterTypeFfiV2SubscribeRequest : - FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): FfiV2SubscribeRequest { - return FfiV2SubscribeRequest( +public object FfiConverterTypeFfiV2SubscribeRequest : FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): FfiV2SubscribeRequest = + FfiV2SubscribeRequest( FfiConverterSequenceString.read(buf), ) - } - override fun allocationSize(value: FfiV2SubscribeRequest) = ( + override fun allocationSize(value: FfiV2SubscribeRequest) = + ( FfiConverterSequenceString.allocationSize(value.`contentTopics`) - ) + ) - override fun write(value: FfiV2SubscribeRequest, buf: ByteBuffer) { + override fun write( + value: FfiV2SubscribeRequest, + buf: ByteBuffer, + ) { FfiConverterSequenceString.write(value.`contentTopics`, buf) } } - enum class FfiDeliveryStatus { - UNPUBLISHED, PUBLISHED, - FAILED; + FAILED, + ; companion object } - public object FfiConverterTypeFfiDeliveryStatus : FfiConverterRustBuffer { - override fun read(buf: ByteBuffer) = try { - FfiDeliveryStatus.values()[buf.getInt() - 1] - } catch (e: IndexOutOfBoundsException) { - throw RuntimeException("invalid enum value, something is very wrong!!", e) - } + override fun read(buf: ByteBuffer) = + try { + FfiDeliveryStatus.values()[buf.getInt() - 1] + } catch (e: IndexOutOfBoundsException) { + throw RuntimeException("invalid enum value, something is very wrong!!", e) + } override fun allocationSize(value: FfiDeliveryStatus) = 4UL - override fun write(value: FfiDeliveryStatus, buf: ByteBuffer) { + override fun write( + value: FfiDeliveryStatus, + buf: ByteBuffer, + ) { buf.putInt(value.ordinal + 1) } } - enum class FfiGroupMessageKind { - APPLICATION, - MEMBERSHIP_CHANGE; + MEMBERSHIP_CHANGE, + ; companion object } - public object FfiConverterTypeFfiGroupMessageKind : FfiConverterRustBuffer { - override fun read(buf: ByteBuffer) = try { - FfiGroupMessageKind.values()[buf.getInt() - 1] - } catch (e: IndexOutOfBoundsException) { - throw RuntimeException("invalid enum value, something is very wrong!!", e) - } + override fun read(buf: ByteBuffer) = + try { + FfiGroupMessageKind.values()[buf.getInt() - 1] + } catch (e: IndexOutOfBoundsException) { + throw RuntimeException("invalid enum value, something is very wrong!!", e) + } override fun allocationSize(value: FfiGroupMessageKind) = 4UL - override fun write(value: FfiGroupMessageKind, buf: ByteBuffer) { + override fun write( + value: FfiGroupMessageKind, + buf: ByteBuffer, + ) { buf.putInt(value.ordinal + 1) } } - enum class FfiGroupPermissionsOptions { - ALL_MEMBERS, ADMIN_ONLY, - CUSTOM_POLICY; + CUSTOM_POLICY, + ; companion object } - -public object FfiConverterTypeFfiGroupPermissionsOptions : - FfiConverterRustBuffer { - override fun read(buf: ByteBuffer) = try { - FfiGroupPermissionsOptions.values()[buf.getInt() - 1] - } catch (e: IndexOutOfBoundsException) { - throw RuntimeException("invalid enum value, something is very wrong!!", e) - } +public object FfiConverterTypeFfiGroupPermissionsOptions : FfiConverterRustBuffer { + override fun read(buf: ByteBuffer) = + try { + FfiGroupPermissionsOptions.values()[buf.getInt() - 1] + } catch (e: IndexOutOfBoundsException) { + throw RuntimeException("invalid enum value, something is very wrong!!", e) + } override fun allocationSize(value: FfiGroupPermissionsOptions) = 4UL - override fun write(value: FfiGroupPermissionsOptions, buf: ByteBuffer) { + override fun write( + value: FfiGroupPermissionsOptions, + buf: ByteBuffer, + ) { buf.putInt(value.ordinal + 1) } } - enum class FfiMetadataField { - GROUP_NAME, DESCRIPTION, IMAGE_URL_SQUARE, - PINNED_FRAME_URL; + PINNED_FRAME_URL, + ; companion object } - public object FfiConverterTypeFfiMetadataField : FfiConverterRustBuffer { - override fun read(buf: ByteBuffer) = try { - FfiMetadataField.values()[buf.getInt() - 1] - } catch (e: IndexOutOfBoundsException) { - throw RuntimeException("invalid enum value, something is very wrong!!", e) - } + override fun read(buf: ByteBuffer) = + try { + FfiMetadataField.values()[buf.getInt() - 1] + } catch (e: IndexOutOfBoundsException) { + throw RuntimeException("invalid enum value, something is very wrong!!", e) + } override fun allocationSize(value: FfiMetadataField) = 4UL - override fun write(value: FfiMetadataField, buf: ByteBuffer) { + override fun write( + value: FfiMetadataField, + buf: ByteBuffer, + ) { buf.putInt(value.ordinal + 1) } } - enum class FfiPermissionLevel { - MEMBER, ADMIN, - SUPER_ADMIN; + SUPER_ADMIN, + ; companion object } - public object FfiConverterTypeFfiPermissionLevel : FfiConverterRustBuffer { - override fun read(buf: ByteBuffer) = try { - FfiPermissionLevel.values()[buf.getInt() - 1] - } catch (e: IndexOutOfBoundsException) { - throw RuntimeException("invalid enum value, something is very wrong!!", e) - } + override fun read(buf: ByteBuffer) = + try { + FfiPermissionLevel.values()[buf.getInt() - 1] + } catch (e: IndexOutOfBoundsException) { + throw RuntimeException("invalid enum value, something is very wrong!!", e) + } override fun allocationSize(value: FfiPermissionLevel) = 4UL - override fun write(value: FfiPermissionLevel, buf: ByteBuffer) { + override fun write( + value: FfiPermissionLevel, + buf: ByteBuffer, + ) { buf.putInt(value.ordinal + 1) } } - enum class FfiPermissionPolicy { - ALLOW, DENY, ADMIN, SUPER_ADMIN, DOES_NOT_EXIST, - OTHER; + OTHER, + ; companion object } - public object FfiConverterTypeFfiPermissionPolicy : FfiConverterRustBuffer { - override fun read(buf: ByteBuffer) = try { - FfiPermissionPolicy.values()[buf.getInt() - 1] - } catch (e: IndexOutOfBoundsException) { - throw RuntimeException("invalid enum value, something is very wrong!!", e) - } + override fun read(buf: ByteBuffer) = + try { + FfiPermissionPolicy.values()[buf.getInt() - 1] + } catch (e: IndexOutOfBoundsException) { + throw RuntimeException("invalid enum value, something is very wrong!!", e) + } override fun allocationSize(value: FfiPermissionPolicy) = 4UL - override fun write(value: FfiPermissionPolicy, buf: ByteBuffer) { + override fun write( + value: FfiPermissionPolicy, + buf: ByteBuffer, + ) { buf.putInt(value.ordinal + 1) } } - enum class FfiPermissionUpdateType { - ADD_MEMBER, REMOVE_MEMBER, ADD_ADMIN, REMOVE_ADMIN, - UPDATE_METADATA; + UPDATE_METADATA, + ; companion object } - -public object FfiConverterTypeFfiPermissionUpdateType : - FfiConverterRustBuffer { - override fun read(buf: ByteBuffer) = try { - FfiPermissionUpdateType.values()[buf.getInt() - 1] - } catch (e: IndexOutOfBoundsException) { - throw RuntimeException("invalid enum value, something is very wrong!!", e) - } +public object FfiConverterTypeFfiPermissionUpdateType : FfiConverterRustBuffer { + override fun read(buf: ByteBuffer) = + try { + FfiPermissionUpdateType.values()[buf.getInt() - 1] + } catch (e: IndexOutOfBoundsException) { + throw RuntimeException("invalid enum value, something is very wrong!!", e) + } override fun allocationSize(value: FfiPermissionUpdateType) = 4UL - override fun write(value: FfiPermissionUpdateType, buf: ByteBuffer) { + override fun write( + value: FfiPermissionUpdateType, + buf: ByteBuffer, + ) { buf.putInt(value.ordinal + 1) } } - enum class FfiSortDirection { - UNSPECIFIED, ASCENDING, - DESCENDING; + DESCENDING, + ; companion object } - public object FfiConverterTypeFfiSortDirection : FfiConverterRustBuffer { - override fun read(buf: ByteBuffer) = try { - FfiSortDirection.values()[buf.getInt() - 1] - } catch (e: IndexOutOfBoundsException) { - throw RuntimeException("invalid enum value, something is very wrong!!", e) - } + override fun read(buf: ByteBuffer) = + try { + FfiSortDirection.values()[buf.getInt() - 1] + } catch (e: IndexOutOfBoundsException) { + throw RuntimeException("invalid enum value, something is very wrong!!", e) + } override fun allocationSize(value: FfiSortDirection) = 4UL - override fun write(value: FfiSortDirection, buf: ByteBuffer) { + override fun write( + value: FfiSortDirection, + buf: ByteBuffer, + ) { buf.putInt(value.ordinal + 1) } } +sealed class GenericException( + message: String, +) : Exception(message) { + class Client( + message: String, + ) : GenericException(message) -sealed class GenericException(message: String) : Exception(message) { - - class Client(message: String) : GenericException(message) - - class ClientBuilder(message: String) : GenericException(message) - - class Storage(message: String) : GenericException(message) + class ClientBuilder( + message: String, + ) : GenericException(message) - class ApiException(message: String) : GenericException(message) + class Storage( + message: String, + ) : GenericException(message) - class GroupException(message: String) : GenericException(message) + class ApiException( + message: String, + ) : GenericException(message) - class Signature(message: String) : GenericException(message) + class GroupException( + message: String, + ) : GenericException(message) - class GroupMetadata(message: String) : GenericException(message) + class Signature( + message: String, + ) : GenericException(message) - class GroupMutablePermissions(message: String) : GenericException(message) + class GroupMetadata( + message: String, + ) : GenericException(message) - class Generic(message: String) : GenericException(message) + class GroupMutablePermissions( + message: String, + ) : GenericException(message) - class SignatureRequestException(message: String) : GenericException(message) + class Generic( + message: String, + ) : GenericException(message) - class Erc1271SignatureException(message: String) : GenericException(message) + class SignatureRequestException( + message: String, + ) : GenericException(message) + class Erc1271SignatureException( + message: String, + ) : GenericException(message) companion object ErrorHandler : UniffiRustCallStatusErrorHandler { - override fun lift(error_buf: RustBuffer.ByValue): GenericException = - FfiConverterTypeGenericError.lift(error_buf) + override fun lift(error_buf: RustBuffer.ByValue): GenericException = FfiConverterTypeGenericError.lift(error_buf) } } public object FfiConverterTypeGenericError : FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): GenericException { - - return when (buf.getInt()) { + override fun read(buf: ByteBuffer): GenericException = + when (buf.getInt()) { 1 -> GenericException.Client(FfiConverterString.read(buf)) 2 -> GenericException.ClientBuilder(FfiConverterString.read(buf)) 3 -> GenericException.Storage(FfiConverterString.read(buf)) @@ -7317,100 +6797,86 @@ public object FfiConverterTypeGenericError : FfiConverterRustBuffer throw RuntimeException("invalid error enum value, something is very wrong!!") } - } - - override fun allocationSize(value: GenericException): ULong { - return 4UL - } + override fun allocationSize(value: GenericException): ULong = 4UL - override fun write(value: GenericException, buf: ByteBuffer) { + override fun write( + value: GenericException, + buf: ByteBuffer, + ) { when (value) { is GenericException.Client -> { buf.putInt(1) Unit } - is GenericException.ClientBuilder -> { buf.putInt(2) Unit } - is GenericException.Storage -> { buf.putInt(3) Unit } - is GenericException.ApiException -> { buf.putInt(4) Unit } - is GenericException.GroupException -> { buf.putInt(5) Unit } - is GenericException.Signature -> { buf.putInt(6) Unit } - is GenericException.GroupMetadata -> { buf.putInt(7) Unit } - is GenericException.GroupMutablePermissions -> { buf.putInt(8) Unit } - is GenericException.Generic -> { buf.putInt(9) Unit } - is GenericException.SignatureRequestException -> { buf.putInt(10) Unit } - is GenericException.Erc1271SignatureException -> { buf.putInt(11) Unit } }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } } - } - -sealed class SigningException(message: String) : Exception(message) { - - class Generic(message: String) : SigningException(message) - +sealed class SigningException( + message: String, +) : Exception(message) { + class Generic( + message: String, + ) : SigningException(message) companion object ErrorHandler : UniffiRustCallStatusErrorHandler { - override fun lift(error_buf: RustBuffer.ByValue): SigningException = - FfiConverterTypeSigningError.lift(error_buf) + override fun lift(error_buf: RustBuffer.ByValue): SigningException = FfiConverterTypeSigningError.lift(error_buf) } } public object FfiConverterTypeSigningError : FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): SigningException { - - return when (buf.getInt()) { + override fun read(buf: ByteBuffer): SigningException = + when (buf.getInt()) { 1 -> SigningException.Generic(FfiConverterString.read(buf)) else -> throw RuntimeException("invalid error enum value, something is very wrong!!") } - } - - override fun allocationSize(value: SigningException): ULong { - return 4UL - } + override fun allocationSize(value: SigningException): ULong = 4UL - override fun write(value: SigningException, buf: ByteBuffer) { + override fun write( + value: SigningException, + buf: ByteBuffer, + ) { when (value) { is SigningException.Generic -> { buf.putInt(1) @@ -7418,12 +6884,9 @@ public object FfiConverterTypeSigningError : FfiConverterRustBuffer : - FfiConverter { +public abstract class FfiConverterCallbackInterface : FfiConverter { internal val handleMap = UniffiHandleMap() internal fun drop(handle: Long) { handleMap.remove(handle) } - override fun lift(value: Long): CallbackInterface { - return handleMap.get(value) - } + override fun lift(value: Long): CallbackInterface = handleMap.get(value) override fun read(buf: ByteBuffer) = lift(buf.getLong()) @@ -7456,7 +6916,10 @@ public abstract class FfiConverterCallbackInterface : override fun allocationSize(value: CallbackInterface) = 8UL - override fun write(value: CallbackInterface, buf: ByteBuffer) { + override fun write( + value: CallbackInterface, + buf: ByteBuffer, + ) { buf.putLong(lower(value)) } } @@ -7471,10 +6934,9 @@ internal object uniffiCallbackInterfaceFfiConversationCallback { uniffiCallStatus: UniffiRustCallStatus, ) { val uniffiObj = FfiConverterTypeFfiConversationCallback.handleMap.get(uniffiHandle) - val makeCall = { -> - uniffiObj.`onConversation`( - FfiConverterTypeFfiGroup.lift(`conversation`), - ) + val makeCall = { uniffiObj.`onConversation`( + FfiConverterTypeFfiGroup.lift(`conversation`), + ) } val writeReturn = { _: Unit -> Unit } uniffiTraitInterfaceCall(uniffiCallStatus, makeCall, writeReturn) @@ -7487,10 +6949,11 @@ internal object uniffiCallbackInterfaceFfiConversationCallback { } } - internal var vtable = UniffiVTableCallbackInterfaceFfiConversationCallback.UniffiByValue( - `onConversation`, - uniffiFree, - ) + internal var vtable = + UniffiVTableCallbackInterfaceFfiConversationCallback.UniffiByValue( + `onConversation`, + uniffiFree, + ) // Registers the foreign callback with the Rust side. // This method is generated for each callback interface. @@ -7500,12 +6963,9 @@ internal object uniffiCallbackInterfaceFfiConversationCallback { } // The ffiConverter which transforms the Callbacks in to handles to pass to Rust. -public object FfiConverterTypeFfiConversationCallback : - FfiConverterCallbackInterface() - +public object FfiConverterTypeFfiConversationCallback : FfiConverterCallbackInterface() public interface FfiInboxOwner { - fun `getAddress`(): kotlin.String fun `sign`(`text`: kotlin.String): kotlin.ByteArray @@ -7513,7 +6973,6 @@ public interface FfiInboxOwner { companion object } - // Put the implementation in an object so we don't pollute the top-level namespace internal object uniffiCallbackInterfaceFfiInboxOwner { internal object `getAddress` : UniffiCallbackInterfaceFfiInboxOwnerMethod0 { @@ -7523,12 +6982,8 @@ internal object uniffiCallbackInterfaceFfiInboxOwner { uniffiCallStatus: UniffiRustCallStatus, ) { val uniffiObj = FfiConverterTypeFfiInboxOwner.handleMap.get(uniffiHandle) - val makeCall = { -> - uniffiObj.`getAddress`( - ) - } - val writeReturn = - { value: kotlin.String -> uniffiOutReturn.setValue(FfiConverterString.lower(value)) } + val makeCall = { uniffiObj.`getAddress`() } + val writeReturn = { value: kotlin.String -> uniffiOutReturn.setValue(FfiConverterString.lower(value)) } uniffiTraitInterfaceCall(uniffiCallStatus, makeCall, writeReturn) } } @@ -7541,21 +6996,16 @@ internal object uniffiCallbackInterfaceFfiInboxOwner { uniffiCallStatus: UniffiRustCallStatus, ) { val uniffiObj = FfiConverterTypeFfiInboxOwner.handleMap.get(uniffiHandle) - val makeCall = { -> - uniffiObj.`sign`( - FfiConverterString.lift(`text`), - ) - } - val writeReturn = { value: kotlin.ByteArray -> - uniffiOutReturn.setValue( - FfiConverterByteArray.lower(value) - ) + val makeCall = { uniffiObj.`sign`( + FfiConverterString.lift(`text`), + ) } + val writeReturn = { value: kotlin.ByteArray -> uniffiOutReturn.setValue(FfiConverterByteArray.lower(value)) } uniffiTraitInterfaceCallWithError( uniffiCallStatus, makeCall, writeReturn, - { e: SigningException -> FfiConverterTypeSigningError.lower(e) } + { e: SigningException -> FfiConverterTypeSigningError.lower(e) }, ) } } @@ -7566,11 +7016,12 @@ internal object uniffiCallbackInterfaceFfiInboxOwner { } } - internal var vtable = UniffiVTableCallbackInterfaceFfiInboxOwner.UniffiByValue( - `getAddress`, - `sign`, - uniffiFree, - ) + internal var vtable = + UniffiVTableCallbackInterfaceFfiInboxOwner.UniffiByValue( + `getAddress`, + `sign`, + uniffiFree, + ) // Registers the foreign callback with the Rust side. // This method is generated for each callback interface. @@ -7582,15 +7033,16 @@ internal object uniffiCallbackInterfaceFfiInboxOwner { // The ffiConverter which transforms the Callbacks in to handles to pass to Rust. public object FfiConverterTypeFfiInboxOwner : FfiConverterCallbackInterface() - public interface FfiLogger { - - fun `log`(`level`: kotlin.UInt, `levelLabel`: kotlin.String, `message`: kotlin.String) + fun `log`( + `level`: kotlin.UInt, + `levelLabel`: kotlin.String, + `message`: kotlin.String, + ) companion object } - // Put the implementation in an object so we don't pollute the top-level namespace internal object uniffiCallbackInterfaceFfiLogger { internal object `log` : UniffiCallbackInterfaceFfiLoggerMethod0 { @@ -7603,12 +7055,11 @@ internal object uniffiCallbackInterfaceFfiLogger { uniffiCallStatus: UniffiRustCallStatus, ) { val uniffiObj = FfiConverterTypeFfiLogger.handleMap.get(uniffiHandle) - val makeCall = { -> - uniffiObj.`log`( - FfiConverterUInt.lift(`level`), - FfiConverterString.lift(`levelLabel`), - FfiConverterString.lift(`message`), - ) + val makeCall = { uniffiObj.`log`( + FfiConverterUInt.lift(`level`), + FfiConverterString.lift(`levelLabel`), + FfiConverterString.lift(`message`), + ) } val writeReturn = { _: Unit -> Unit } uniffiTraitInterfaceCall(uniffiCallStatus, makeCall, writeReturn) @@ -7621,10 +7072,11 @@ internal object uniffiCallbackInterfaceFfiLogger { } } - internal var vtable = UniffiVTableCallbackInterfaceFfiLogger.UniffiByValue( - `log`, - uniffiFree, - ) + internal var vtable = + UniffiVTableCallbackInterfaceFfiLogger.UniffiByValue( + `log`, + uniffiFree, + ) // Registers the foreign callback with the Rust side. // This method is generated for each callback interface. @@ -7636,15 +7088,12 @@ internal object uniffiCallbackInterfaceFfiLogger { // The ffiConverter which transforms the Callbacks in to handles to pass to Rust. public object FfiConverterTypeFfiLogger : FfiConverterCallbackInterface() - public interface FfiMessageCallback { - fun `onMessage`(`message`: FfiMessage) companion object } - // Put the implementation in an object so we don't pollute the top-level namespace internal object uniffiCallbackInterfaceFfiMessageCallback { internal object `onMessage` : UniffiCallbackInterfaceFfiMessageCallbackMethod0 { @@ -7655,10 +7104,9 @@ internal object uniffiCallbackInterfaceFfiMessageCallback { uniffiCallStatus: UniffiRustCallStatus, ) { val uniffiObj = FfiConverterTypeFfiMessageCallback.handleMap.get(uniffiHandle) - val makeCall = { -> - uniffiObj.`onMessage`( - FfiConverterTypeFfiMessage.lift(`message`), - ) + val makeCall = { uniffiObj.`onMessage`( + FfiConverterTypeFfiMessage.lift(`message`), + ) } val writeReturn = { _: Unit -> Unit } uniffiTraitInterfaceCall(uniffiCallStatus, makeCall, writeReturn) @@ -7671,10 +7119,11 @@ internal object uniffiCallbackInterfaceFfiMessageCallback { } } - internal var vtable = UniffiVTableCallbackInterfaceFfiMessageCallback.UniffiByValue( - `onMessage`, - uniffiFree, - ) + internal var vtable = + UniffiVTableCallbackInterfaceFfiMessageCallback.UniffiByValue( + `onMessage`, + uniffiFree, + ) // Registers the foreign callback with the Rust side. // This method is generated for each callback interface. @@ -7684,18 +7133,14 @@ internal object uniffiCallbackInterfaceFfiMessageCallback { } // The ffiConverter which transforms the Callbacks in to handles to pass to Rust. -public object FfiConverterTypeFfiMessageCallback : - FfiConverterCallbackInterface() - +public object FfiConverterTypeFfiMessageCallback : FfiConverterCallbackInterface() public interface FfiV2SubscriptionCallback { - fun `onMessage`(`message`: FfiEnvelope) companion object } - // Put the implementation in an object so we don't pollute the top-level namespace internal object uniffiCallbackInterfaceFfiV2SubscriptionCallback { internal object `onMessage` : UniffiCallbackInterfaceFfiV2SubscriptionCallbackMethod0 { @@ -7706,10 +7151,9 @@ internal object uniffiCallbackInterfaceFfiV2SubscriptionCallback { uniffiCallStatus: UniffiRustCallStatus, ) { val uniffiObj = FfiConverterTypeFfiV2SubscriptionCallback.handleMap.get(uniffiHandle) - val makeCall = { -> - uniffiObj.`onMessage`( - FfiConverterTypeFfiEnvelope.lift(`message`), - ) + val makeCall = { uniffiObj.`onMessage`( + FfiConverterTypeFfiEnvelope.lift(`message`), + ) } val writeReturn = { _: Unit -> Unit } uniffiTraitInterfaceCall(uniffiCallStatus, makeCall, writeReturn) @@ -7722,10 +7166,11 @@ internal object uniffiCallbackInterfaceFfiV2SubscriptionCallback { } } - internal var vtable = UniffiVTableCallbackInterfaceFfiV2SubscriptionCallback.UniffiByValue( - `onMessage`, - uniffiFree, - ) + internal var vtable = + UniffiVTableCallbackInterfaceFfiV2SubscriptionCallback.UniffiByValue( + `onMessage`, + uniffiFree, + ) // Registers the foreign callback with the Rust side. // This method is generated for each callback interface. @@ -7735,9 +7180,7 @@ internal object uniffiCallbackInterfaceFfiV2SubscriptionCallback { } // The ffiConverter which transforms the Callbacks in to handles to pass to Rust. -public object FfiConverterTypeFfiV2SubscriptionCallback : - FfiConverterCallbackInterface() - +public object FfiConverterTypeFfiV2SubscriptionCallback : FfiConverterCallbackInterface() public object FfiConverterOptionalLong : FfiConverterRustBuffer { override fun read(buf: ByteBuffer): kotlin.Long? { @@ -7755,7 +7198,10 @@ public object FfiConverterOptionalLong : FfiConverterRustBuffer { } } - override fun write(value: kotlin.Long?, buf: ByteBuffer) { + override fun write( + value: kotlin.Long?, + buf: ByteBuffer, + ) { if (value == null) { buf.put(0) } else { @@ -7765,7 +7211,6 @@ public object FfiConverterOptionalLong : FfiConverterRustBuffer { } } - public object FfiConverterOptionalString : FfiConverterRustBuffer { override fun read(buf: ByteBuffer): kotlin.String? { if (buf.get().toInt() == 0) { @@ -7782,7 +7227,10 @@ public object FfiConverterOptionalString : FfiConverterRustBuffer { override fun read(buf: ByteBuffer): kotlin.ByteArray? { if (buf.get().toInt() == 0) { @@ -7809,7 +7256,10 @@ public object FfiConverterOptionalByteArray : FfiConverterRustBuffer { +public object FfiConverterOptionalTypeFfiSignatureRequest : FfiConverterRustBuffer { override fun read(buf: ByteBuffer): FfiSignatureRequest? { if (buf.get().toInt() == 0) { return null @@ -7837,7 +7285,10 @@ public object FfiConverterOptionalTypeFfiSignatureRequest : } } - override fun write(value: FfiSignatureRequest?, buf: ByteBuffer) { + override fun write( + value: FfiSignatureRequest?, + buf: ByteBuffer, + ) { if (value == null) { buf.put(0) } else { @@ -7847,7 +7298,6 @@ public object FfiConverterOptionalTypeFfiSignatureRequest : } } - public object FfiConverterOptionalTypeFfiCursor : FfiConverterRustBuffer { override fun read(buf: ByteBuffer): FfiCursor? { if (buf.get().toInt() == 0) { @@ -7864,7 +7314,10 @@ public object FfiConverterOptionalTypeFfiCursor : FfiConverterRustBuffer { override fun read(buf: ByteBuffer): FfiPagingInfo? { if (buf.get().toInt() == 0) { @@ -7891,7 +7343,10 @@ public object FfiConverterOptionalTypeFfiPagingInfo : FfiConverterRustBuffer { +public object FfiConverterOptionalTypeFfiPermissionPolicySet : FfiConverterRustBuffer { override fun read(buf: ByteBuffer): FfiPermissionPolicySet? { if (buf.get().toInt() == 0) { return null @@ -7919,7 +7372,10 @@ public object FfiConverterOptionalTypeFfiPermissionPolicySet : } } - override fun write(value: FfiPermissionPolicySet?, buf: ByteBuffer) { + override fun write( + value: FfiPermissionPolicySet?, + buf: ByteBuffer, + ) { if (value == null) { buf.put(0) } else { @@ -7929,9 +7385,7 @@ public object FfiConverterOptionalTypeFfiPermissionPolicySet : } } - -public object FfiConverterOptionalTypeFfiDeliveryStatus : - FfiConverterRustBuffer { +public object FfiConverterOptionalTypeFfiDeliveryStatus : FfiConverterRustBuffer { override fun read(buf: ByteBuffer): FfiDeliveryStatus? { if (buf.get().toInt() == 0) { return null @@ -7947,7 +7401,10 @@ public object FfiConverterOptionalTypeFfiDeliveryStatus : } } - override fun write(value: FfiDeliveryStatus?, buf: ByteBuffer) { + override fun write( + value: FfiDeliveryStatus?, + buf: ByteBuffer, + ) { if (value == null) { buf.put(0) } else { @@ -7957,9 +7414,7 @@ public object FfiConverterOptionalTypeFfiDeliveryStatus : } } - -public object FfiConverterOptionalTypeFfiGroupPermissionsOptions : - FfiConverterRustBuffer { +public object FfiConverterOptionalTypeFfiGroupPermissionsOptions : FfiConverterRustBuffer { override fun read(buf: ByteBuffer): FfiGroupPermissionsOptions? { if (buf.get().toInt() == 0) { return null @@ -7975,7 +7430,10 @@ public object FfiConverterOptionalTypeFfiGroupPermissionsOptions : } } - override fun write(value: FfiGroupPermissionsOptions?, buf: ByteBuffer) { + override fun write( + value: FfiGroupPermissionsOptions?, + buf: ByteBuffer, + ) { if (value == null) { buf.put(0) } else { @@ -7985,7 +7443,6 @@ public object FfiConverterOptionalTypeFfiGroupPermissionsOptions : } } - public object FfiConverterOptionalTypeFfiMetadataField : FfiConverterRustBuffer { override fun read(buf: ByteBuffer): FfiMetadataField? { if (buf.get().toInt() == 0) { @@ -8002,7 +7459,10 @@ public object FfiConverterOptionalTypeFfiMetadataField : FfiConverterRustBuffer< } } - override fun write(value: FfiMetadataField?, buf: ByteBuffer) { + override fun write( + value: FfiMetadataField?, + buf: ByteBuffer, + ) { if (value == null) { buf.put(0) } else { @@ -8012,7 +7472,6 @@ public object FfiConverterOptionalTypeFfiMetadataField : FfiConverterRustBuffer< } } - public object FfiConverterSequenceString : FfiConverterRustBuffer> { override fun read(buf: ByteBuffer): List { val len = buf.getInt() @@ -8027,7 +7486,10 @@ public object FfiConverterSequenceString : FfiConverterRustBuffer, buf: ByteBuffer) { + override fun write( + value: List, + buf: ByteBuffer, + ) { buf.putInt(value.size) value.iterator().forEach { FfiConverterString.write(it, buf) @@ -8035,7 +7497,6 @@ public object FfiConverterSequenceString : FfiConverterRustBuffer> { override fun read(buf: ByteBuffer): List { val len = buf.getInt() @@ -8050,7 +7511,10 @@ public object FfiConverterSequenceByteArray : FfiConverterRustBuffer, buf: ByteBuffer) { + override fun write( + value: List, + buf: ByteBuffer, + ) { buf.putInt(value.size) value.iterator().forEach { FfiConverterByteArray.write(it, buf) @@ -8058,7 +7522,6 @@ public object FfiConverterSequenceByteArray : FfiConverterRustBuffer> { override fun read(buf: ByteBuffer): List { val len = buf.getInt() @@ -8073,7 +7536,10 @@ public object FfiConverterSequenceTypeFfiGroup : FfiConverterRustBuffer, buf: ByteBuffer) { + override fun write( + value: List, + buf: ByteBuffer, + ) { buf.putInt(value.size) value.iterator().forEach { FfiConverterTypeFfiGroup.write(it, buf) @@ -8081,7 +7547,6 @@ public object FfiConverterSequenceTypeFfiGroup : FfiConverterRustBuffer> { override fun read(buf: ByteBuffer): List { val len = buf.getInt() @@ -8096,7 +7561,10 @@ public object FfiConverterSequenceTypeFfiEnvelope : FfiConverterRustBuffer, buf: ByteBuffer) { + override fun write( + value: List, + buf: ByteBuffer, + ) { buf.putInt(value.size) value.iterator().forEach { FfiConverterTypeFfiEnvelope.write(it, buf) @@ -8104,9 +7572,7 @@ public object FfiConverterSequenceTypeFfiEnvelope : FfiConverterRustBuffer> { +public object FfiConverterSequenceTypeFfiGroupMember : FfiConverterRustBuffer> { override fun read(buf: ByteBuffer): List { val len = buf.getInt() return List(len) { @@ -8120,7 +7586,10 @@ public object FfiConverterSequenceTypeFfiGroupMember : return sizeForLength + sizeForItems } - override fun write(value: List, buf: ByteBuffer) { + override fun write( + value: List, + buf: ByteBuffer, + ) { buf.putInt(value.size) value.iterator().forEach { FfiConverterTypeFfiGroupMember.write(it, buf) @@ -8128,7 +7597,6 @@ public object FfiConverterSequenceTypeFfiGroupMember : } } - public object FfiConverterSequenceTypeFfiMessage : FfiConverterRustBuffer> { override fun read(buf: ByteBuffer): List { val len = buf.getInt() @@ -8143,7 +7611,10 @@ public object FfiConverterSequenceTypeFfiMessage : FfiConverterRustBuffer, buf: ByteBuffer) { + override fun write( + value: List, + buf: ByteBuffer, + ) { buf.putInt(value.size) value.iterator().forEach { FfiConverterTypeFfiMessage.write(it, buf) @@ -8151,9 +7622,7 @@ public object FfiConverterSequenceTypeFfiMessage : FfiConverterRustBuffer> { +public object FfiConverterSequenceTypeFfiV2QueryRequest : FfiConverterRustBuffer> { override fun read(buf: ByteBuffer): List { val len = buf.getInt() return List(len) { @@ -8167,7 +7636,10 @@ public object FfiConverterSequenceTypeFfiV2QueryRequest : return sizeForLength + sizeForItems } - override fun write(value: List, buf: ByteBuffer) { + override fun write( + value: List, + buf: ByteBuffer, + ) { buf.putInt(value.size) value.iterator().forEach { FfiConverterTypeFfiV2QueryRequest.write(it, buf) @@ -8175,9 +7647,7 @@ public object FfiConverterSequenceTypeFfiV2QueryRequest : } } - -public object FfiConverterSequenceTypeFfiV2QueryResponse : - FfiConverterRustBuffer> { +public object FfiConverterSequenceTypeFfiV2QueryResponse : FfiConverterRustBuffer> { override fun read(buf: ByteBuffer): List { val len = buf.getInt() return List(len) { @@ -8191,7 +7661,10 @@ public object FfiConverterSequenceTypeFfiV2QueryResponse : return sizeForLength + sizeForItems } - override fun write(value: List, buf: ByteBuffer) { + override fun write( + value: List, + buf: ByteBuffer, + ) { buf.putInt(value.size) value.iterator().forEach { FfiConverterTypeFfiV2QueryResponse.write(it, buf) @@ -8199,9 +7672,7 @@ public object FfiConverterSequenceTypeFfiV2QueryResponse : } } - -public object FfiConverterMapStringBoolean : - FfiConverterRustBuffer> { +public object FfiConverterMapStringBoolean : FfiConverterRustBuffer> { override fun read(buf: ByteBuffer): Map { val len = buf.getInt() return buildMap(len) { @@ -8215,26 +7686,30 @@ public object FfiConverterMapStringBoolean : override fun allocationSize(value: Map): ULong { val spaceForMapSize = 4UL - val spaceForChildren = value.map { (k, v) -> - FfiConverterString.allocationSize(k) + - FfiConverterBoolean.allocationSize(v) - }.sum() + val spaceForChildren = + value + .map { (k, v) -> + FfiConverterString.allocationSize(k) + + FfiConverterBoolean.allocationSize(v) + }.sum() return spaceForMapSize + spaceForChildren } - override fun write(value: Map, buf: ByteBuffer) { + override fun write( + value: Map, + buf: ByteBuffer, + ) { buf.putInt(value.size) // The parens on `(k, v)` here ensure we're calling the right method, // which is important for compatibility with older android devices. // Ref https://blog.danlew.net/2017/03/16/kotlin-puzzler-whose-line-is-it-anyways/ - value.iterator().forEach { (k, v) -> + value.forEach { (k, v) -> FfiConverterString.write(k, buf) FfiConverterBoolean.write(v, buf) } } } - /** * It returns a new client of the specified `inbox_id`. * Note that the `inbox_id` must be either brand new or already associated with the `account_address`. @@ -8268,13 +7743,11 @@ suspend fun `createClient`( `accountAddress`: kotlin.String, `nonce`: kotlin.ULong, `legacySignedPrivateKeyProto`: kotlin.ByteArray?, - `historySyncUrl`: kotlin.String? -): FfiXmtpClient { - return uniffiRustCallAsync( + `historySyncUrl`: kotlin.String?, +): FfiXmtpClient = + uniffiRustCallAsync( UniffiLib.INSTANCE.uniffi_xmtpv3_fn_func_create_client( - FfiConverterTypeFfiLogger.lower( - `logger` - ), + FfiConverterTypeFfiLogger.lower(`logger`), FfiConverterString.lower(`host`), FfiConverterBoolean.lower(`isSecure`), FfiConverterOptionalString.lower(`db`), @@ -8285,96 +7758,71 @@ suspend fun `createClient`( FfiConverterOptionalByteArray.lower(`legacySignedPrivateKeyProto`), FfiConverterOptionalString.lower(`historySyncUrl`), ), - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_pointer( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_pointer( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_pointer(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_pointer(future) }, // lift function { FfiConverterTypeFfiXmtpClient.lift(it) }, // Error FFI converter GenericException.ErrorHandler, ) -} @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") -suspend fun `createV2Client`(`host`: kotlin.String, `isSecure`: kotlin.Boolean): FfiV2ApiClient { - return uniffiRustCallAsync( - UniffiLib.INSTANCE.uniffi_xmtpv3_fn_func_create_v2_client( - FfiConverterString.lower(`host`), - FfiConverterBoolean.lower(`isSecure`), - ), - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_pointer( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_pointer( - future, - continuation - ) - }, +suspend fun `createV2Client`( + `host`: kotlin.String, + `isSecure`: kotlin.Boolean, +): FfiV2ApiClient = + uniffiRustCallAsync( + UniffiLib.INSTANCE.uniffi_xmtpv3_fn_func_create_v2_client(FfiConverterString.lower(`host`), FfiConverterBoolean.lower(`isSecure`)), + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_pointer(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_pointer(future) }, // lift function { FfiConverterTypeFfiV2ApiClient.lift(it) }, // Error FFI converter GenericException.ErrorHandler, ) -} @Throws(GenericException::class) fun `diffieHellmanK256`( `privateKeyBytes`: kotlin.ByteArray, - `publicKeyBytes`: kotlin.ByteArray -): kotlin.ByteArray { - return FfiConverterByteArray.lift( + `publicKeyBytes`: kotlin.ByteArray, +): kotlin.ByteArray = + FfiConverterByteArray.lift( uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_func_diffie_hellman_k256( FfiConverterByteArray.lower(`privateKeyBytes`), FfiConverterByteArray.lower(`publicKeyBytes`), - _status + _status, ) - } + }, ) -} -fun `generateInboxId`(`accountAddress`: kotlin.String, `nonce`: kotlin.ULong): kotlin.String { - return FfiConverterString.lift( - uniffiRustCall() { _status -> +fun `generateInboxId`( + `accountAddress`: kotlin.String, + `nonce`: kotlin.ULong, +): kotlin.String = + FfiConverterString.lift( + uniffiRustCall { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_func_generate_inbox_id( FfiConverterString.lower(`accountAddress`), FfiConverterULong.lower(`nonce`), - _status + _status, ) - } + }, ) -} - @Throws(GenericException::class) -fun `generatePrivatePreferencesTopicIdentifier`(`privateKey`: kotlin.ByteArray): kotlin.String { - return FfiConverterString.lift( +fun `generatePrivatePreferencesTopicIdentifier`(`privateKey`: kotlin.ByteArray): kotlin.String = + FfiConverterString.lift( uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_func_generate_private_preferences_topic_identifier( - FfiConverterByteArray.lower(`privateKey`), _status + FfiConverterByteArray.lower(`privateKey`), + _status, ) - } + }, ) -} - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") @@ -8382,189 +7830,158 @@ suspend fun `getInboxIdForAddress`( `logger`: FfiLogger, `host`: kotlin.String, `isSecure`: kotlin.Boolean, - `accountAddress`: kotlin.String -): kotlin.String? { - return uniffiRustCallAsync( + `accountAddress`: kotlin.String, +): kotlin.String? = + uniffiRustCallAsync( UniffiLib.INSTANCE.uniffi_xmtpv3_fn_func_get_inbox_id_for_address( - FfiConverterTypeFfiLogger.lower( - `logger` - ), + FfiConverterTypeFfiLogger.lower(`logger`), FfiConverterString.lower(`host`), FfiConverterBoolean.lower(`isSecure`), FfiConverterString.lower(`accountAddress`), ), - { future, callback, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_rust_buffer( - future, - callback, - continuation - ) - }, - { future, continuation -> - UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_rust_buffer( - future, - continuation - ) - }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_rust_buffer(future, continuation) }, { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterOptionalString.lift(it) }, // Error FFI converter GenericException.ErrorHandler, ) -} -fun `getVersionInfo`(): kotlin.String { - return FfiConverterString.lift( - uniffiRustCall() { _status -> +fun `getVersionInfo`(): kotlin.String = + FfiConverterString.lift( + uniffiRustCall { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_func_get_version_info( - _status + _status, ) - } + }, ) -} -fun `keccak256`(`input`: kotlin.ByteArray): kotlin.ByteArray { - return FfiConverterByteArray.lift( - uniffiRustCall() { _status -> +fun `keccak256`(`input`: kotlin.ByteArray): kotlin.ByteArray = + FfiConverterByteArray.lift( + uniffiRustCall { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_func_keccak256( - FfiConverterByteArray.lower(`input`), _status + FfiConverterByteArray.lower(`input`), + _status, ) - } + }, ) -} - @Throws(GenericException::class) -fun `publicKeyFromPrivateKeyK256`(`privateKeyBytes`: kotlin.ByteArray): kotlin.ByteArray { - return FfiConverterByteArray.lift( +fun `publicKeyFromPrivateKeyK256`(`privateKeyBytes`: kotlin.ByteArray): kotlin.ByteArray = + FfiConverterByteArray.lift( uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_func_public_key_from_private_key_k256( - FfiConverterByteArray.lower(`privateKeyBytes`), _status + FfiConverterByteArray.lower(`privateKeyBytes`), + _status, ) - } + }, ) -} - @Throws(GenericException::class) fun `recoverAddress`( `signatureBytes`: kotlin.ByteArray, - `predigestMessage`: kotlin.String -): kotlin.String { - return FfiConverterString.lift( + `predigestMessage`: kotlin.String, +): kotlin.String = + FfiConverterString.lift( uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_func_recover_address( FfiConverterByteArray.lower(`signatureBytes`), FfiConverterString.lower(`predigestMessage`), - _status + _status, ) - } + }, ) -} - @Throws(GenericException::class) fun `recoverPublicKeyK256Keccak256`( `message`: kotlin.ByteArray, - `signature`: kotlin.ByteArray -): kotlin.ByteArray { - return FfiConverterByteArray.lift( + `signature`: kotlin.ByteArray, +): kotlin.ByteArray = + FfiConverterByteArray.lift( uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_func_recover_public_key_k256_keccak256( FfiConverterByteArray.lower(`message`), FfiConverterByteArray.lower(`signature`), - _status + _status, ) - } + }, ) -} - @Throws(GenericException::class) fun `recoverPublicKeyK256Sha256`( `message`: kotlin.ByteArray, - `signature`: kotlin.ByteArray -): kotlin.ByteArray { - return FfiConverterByteArray.lift( + `signature`: kotlin.ByteArray, +): kotlin.ByteArray = + FfiConverterByteArray.lift( uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_func_recover_public_key_k256_sha256( FfiConverterByteArray.lower(`message`), FfiConverterByteArray.lower(`signature`), - _status + _status, ) - } + }, ) -} -fun `sha256`(`input`: kotlin.ByteArray): kotlin.ByteArray { - return FfiConverterByteArray.lift( - uniffiRustCall() { _status -> +fun `sha256`(`input`: kotlin.ByteArray): kotlin.ByteArray = + FfiConverterByteArray.lift( + uniffiRustCall { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_func_sha256( - FfiConverterByteArray.lower(`input`), _status + FfiConverterByteArray.lower(`input`), + _status, ) - } + }, ) -} - @Throws(GenericException::class) fun `userPreferencesDecrypt`( `publicKey`: kotlin.ByteArray, `privateKey`: kotlin.ByteArray, - `message`: kotlin.ByteArray -): kotlin.ByteArray { - return FfiConverterByteArray.lift( + `message`: kotlin.ByteArray, +): kotlin.ByteArray = + FfiConverterByteArray.lift( uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_func_user_preferences_decrypt( FfiConverterByteArray.lower(`publicKey`), FfiConverterByteArray.lower(`privateKey`), FfiConverterByteArray.lower(`message`), - _status + _status, ) - } + }, ) -} - @Throws(GenericException::class) fun `userPreferencesEncrypt`( `publicKey`: kotlin.ByteArray, `privateKey`: kotlin.ByteArray, - `message`: kotlin.ByteArray -): kotlin.ByteArray { - return FfiConverterByteArray.lift( + `message`: kotlin.ByteArray, +): kotlin.ByteArray = + FfiConverterByteArray.lift( uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_func_user_preferences_encrypt( FfiConverterByteArray.lower(`publicKey`), FfiConverterByteArray.lower(`privateKey`), FfiConverterByteArray.lower(`message`), - _status + _status, ) - } + }, ) -} - @Throws(GenericException::class) fun `verifyK256Sha256`( `signedBy`: kotlin.ByteArray, `message`: kotlin.ByteArray, `signature`: kotlin.ByteArray, - `recoveryId`: kotlin.UByte -): kotlin.Boolean { - return FfiConverterBoolean.lift( + `recoveryId`: kotlin.UByte, +): kotlin.Boolean = + FfiConverterBoolean.lift( uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_func_verify_k256_sha256( FfiConverterByteArray.lower(`signedBy`), FfiConverterByteArray.lower(`message`), FfiConverterByteArray.lower(`signature`), FfiConverterUByte.lower(`recoveryId`), - _status + _status, ) - } + }, ) -} - - - diff --git a/library/src/main/jniLibs/arm64-v8a/libuniffi_xmtpv3.so b/library/src/main/jniLibs/arm64-v8a/libuniffi_xmtpv3.so index 2a84e6ca1..fd83ff30a 100644 Binary files a/library/src/main/jniLibs/arm64-v8a/libuniffi_xmtpv3.so and b/library/src/main/jniLibs/arm64-v8a/libuniffi_xmtpv3.so differ diff --git a/library/src/main/jniLibs/armeabi-v7a/libuniffi_xmtpv3.so b/library/src/main/jniLibs/armeabi-v7a/libuniffi_xmtpv3.so index f7a7510b9..5492653f7 100644 Binary files a/library/src/main/jniLibs/armeabi-v7a/libuniffi_xmtpv3.so and b/library/src/main/jniLibs/armeabi-v7a/libuniffi_xmtpv3.so differ diff --git a/library/src/main/jniLibs/x86/libuniffi_xmtpv3.so b/library/src/main/jniLibs/x86/libuniffi_xmtpv3.so index f7911d36f..92f7a77f1 100644 Binary files a/library/src/main/jniLibs/x86/libuniffi_xmtpv3.so and b/library/src/main/jniLibs/x86/libuniffi_xmtpv3.so differ diff --git a/library/src/main/jniLibs/x86_64/libuniffi_xmtpv3.so b/library/src/main/jniLibs/x86_64/libuniffi_xmtpv3.so index 766e033e3..8b842d5e2 100644 Binary files a/library/src/main/jniLibs/x86_64/libuniffi_xmtpv3.so and b/library/src/main/jniLibs/x86_64/libuniffi_xmtpv3.so differ