diff --git a/buildSrc/src/main/kotlin/BuildVersionsSDK.kt b/buildSrc/src/main/kotlin/BuildVersionsSDK.kt index 91d3d5a..d3e5e02 100644 --- a/buildSrc/src/main/kotlin/BuildVersionsSDK.kt +++ b/buildSrc/src/main/kotlin/BuildVersionsSDK.kt @@ -1,5 +1,5 @@ object BuildVersionsSDK { const val majorVersion = 0 const val minorVersion = 1 - const val patchVersion = 93 + const val patchVersion = 94 } diff --git a/sdk/sdk-android/src/main/kotlin/org/matrix/rustcomponents/sdk/matrix_sdk_ffi.kt b/sdk/sdk-android/src/main/kotlin/org/matrix/rustcomponents/sdk/matrix_sdk_ffi.kt index dd18f51..5e606e9 100644 --- a/sdk/sdk-android/src/main/kotlin/org/matrix/rustcomponents/sdk/matrix_sdk_ffi.kt +++ b/sdk/sdk-android/src/main/kotlin/org/matrix/rustcomponents/sdk/matrix_sdk_ffi.kt @@ -57,8 +57,8 @@ open class RustBuffer : Structure() { class ByReference: RustBuffer(), Structure.ByReference companion object { - internal fun alloc(size: Int = 0) = rustCall() { status -> - _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rustbuffer_alloc(size, status) + internal fun alloc(size: Int = 0) = uniffiRustCall() { status -> + UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rustbuffer_alloc(size, status) }.also { if(it.data == null) { throw RuntimeException("RustBuffer.alloc() returned null data pointer (size=${size})") @@ -73,8 +73,8 @@ open class RustBuffer : Structure() { return buf } - internal fun free(buf: RustBuffer.ByValue) = rustCall() { status -> - _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rustbuffer_free(buf, status) + internal fun free(buf: RustBuffer.ByValue) = uniffiRustCall() { status -> + UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rustbuffer_free(buf, status) } } @@ -205,11 +205,11 @@ public interface FfiConverterRustBuffer: FfiConverter { +interface UniffiRustCallStatusErrorHandler { fun lift(error_buf: RustBuffer.ByValue): E; } @@ -236,15 +236,15 @@ interface CallStatusErrorHandler { // synchronize itself // Call a rust function that returns a Result<>. Pass in the Error class companion that corresponds to the Err -private inline fun rustCallWithError(errorHandler: CallStatusErrorHandler, callback: (RustCallStatus) -> U): U { - var status = RustCallStatus(); +private inline fun uniffiRustCallWithError(errorHandler: UniffiRustCallStatusErrorHandler, callback: (UniffiRustCallStatus) -> U): U { + var status = UniffiRustCallStatus(); val return_value = callback(status) - checkCallStatus(errorHandler, status) + uniffiCheckCallStatus(errorHandler, status) return return_value } -// Check RustCallStatus and throw an error if the call wasn't successful -private fun checkCallStatus(errorHandler: CallStatusErrorHandler, status: RustCallStatus) { +// Check UniffiRustCallStatus and throw an error if the call wasn't successful +private fun uniffiCheckCallStatus(errorHandler: UniffiRustCallStatusErrorHandler, status: UniffiRustCallStatus) { if (status.isSuccess()) { return } else if (status.isError()) { @@ -263,8 +263,8 @@ private fun checkCallStatus(errorHandler: CallStatusErrorHandler { +// UniffiRustCallStatusErrorHandler implementation for times when we don't expect a CALL_ERROR +object UniffiNullRustCallStatusErrorHandler: UniffiRustCallStatusErrorHandler { override fun lift(error_buf: RustBuffer.ByValue): InternalException { RustBuffer.free(error_buf) return InternalException("Unexpected CALL_ERROR") @@ -272,8 +272,8 @@ object NullCallStatusErrorHandler: CallStatusErrorHandler { } // Call a rust function that returns a plain value -private inline fun rustCall(callback: (RustCallStatus) -> U): U { - return rustCallWithError(NullCallStatusErrorHandler, callback); +private inline fun uniffiRustCall(callback: (UniffiRustCallStatus) -> U): U { + return uniffiRustCallWithError(UniffiNullRustCallStatusErrorHandler, callback); } // IntegerType that matches Rust's `usize` / C's `size_t` @@ -383,11 +383,11 @@ private inline fun loadIndirect( // A JNA Library to expose the extern-C FFI definitions. // This is an implementation detail which will be called internally by the public API. -internal interface _UniFFILib : Library { +internal interface UniffiLib : Library { companion object { - internal val INSTANCE: _UniFFILib by lazy { - loadIndirect<_UniFFILib>(componentName = "matrix_sdk_ffi") - .also { lib: _UniFFILib -> + internal val INSTANCE: UniffiLib by lazy { + loadIndirect(componentName = "matrix_sdk_ffi") + .also { lib: UniffiLib -> uniffiCheckContractApiVersion(lib) uniffiCheckApiChecksums(lib) uniffiCallbackInterfaceBackPaginationStatusListener.register(lib) @@ -410,61 +410,66 @@ internal interface _UniFFILib : Library { uniffiCallbackInterfaceWidgetCapabilitiesProvider.register(lib) } } + + // The Cleaner for the whole library + internal val CLEANER: UniffiCleaner by lazy { + UniffiCleaner.create() + } } - fun uniffi_matrix_sdk_ffi_fn_clone_mediasource(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_mediasource(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_mediasource(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_mediasource(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_constructor_mediasource_from_json(`json`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_constructor_mediasource_from_json(`json`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_mediasource_to_json(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_mediasource_to_json(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_mediasource_url(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_mediasource_url(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_clone_roommessageeventcontentwithoutrelation(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_roommessageeventcontentwithoutrelation(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_roommessageeventcontentwithoutrelation(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_roommessageeventcontentwithoutrelation(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_roommessageeventcontentwithoutrelation_with_mentions(`ptr`: Pointer,`mentions`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roommessageeventcontentwithoutrelation_with_mentions(`ptr`: Pointer,`mentions`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_clone_authenticationservice(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_authenticationservice(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_authenticationservice(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_authenticationservice(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_constructor_authenticationservice_new(`basePath`: RustBuffer.ByValue,`passphrase`: RustBuffer.ByValue,`userAgent`: RustBuffer.ByValue,`oidcConfiguration`: RustBuffer.ByValue,`customSlidingSyncProxy`: RustBuffer.ByValue,`sessionDelegate`: RustBuffer.ByValue,`crossProcessRefreshLockId`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_constructor_authenticationservice_new(`basePath`: RustBuffer.ByValue,`passphrase`: RustBuffer.ByValue,`userAgent`: RustBuffer.ByValue,`oidcConfiguration`: RustBuffer.ByValue,`customSlidingSyncProxy`: RustBuffer.ByValue,`sessionDelegate`: RustBuffer.ByValue,`crossProcessRefreshLockId`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_authenticationservice_configure_homeserver(`ptr`: Pointer,`serverNameOrHomeserverUrl`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_authenticationservice_configure_homeserver(`ptr`: Pointer,`serverNameOrHomeserverUrl`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_authenticationservice_homeserver_details(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_authenticationservice_homeserver_details(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_authenticationservice_login(`ptr`: Pointer,`username`: RustBuffer.ByValue,`password`: RustBuffer.ByValue,`initialDeviceName`: RustBuffer.ByValue,`deviceId`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_authenticationservice_login(`ptr`: Pointer,`username`: RustBuffer.ByValue,`password`: RustBuffer.ByValue,`initialDeviceName`: RustBuffer.ByValue,`deviceId`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_authenticationservice_login_with_oidc_callback(`ptr`: Pointer,`authenticationData`: Pointer,`callbackUrl`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_authenticationservice_login_with_oidc_callback(`ptr`: Pointer,`authenticationData`: Pointer,`callbackUrl`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_authenticationservice_url_for_oidc_login(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_authenticationservice_url_for_oidc_login(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_clone_client(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_client(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_client(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_client(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_client_account_data(`ptr`: Pointer,`eventType`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_account_data(`ptr`: Pointer,`eventType`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_client_account_url(`ptr`: Pointer,`action`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_account_url(`ptr`: Pointer,`action`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_client_avatar_url(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_avatar_url(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_client_cached_avatar_url(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_cached_avatar_url(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_client_create_room(`ptr`: Pointer,`request`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_create_room(`ptr`: Pointer,`request`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_client_device_id(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_device_id(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_client_display_name(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_display_name(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_client_encryption(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_encryption(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_client_get_dm_room(`ptr`: Pointer,`userId`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_get_dm_room(`ptr`: Pointer,`userId`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_matrix_sdk_ffi_fn_method_client_get_media_content(`ptr`: Pointer,`mediaSource`: Pointer, ): Pointer @@ -472,93 +477,93 @@ internal interface _UniFFILib : Library { ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_client_get_media_thumbnail(`ptr`: Pointer,`mediaSource`: Pointer,`width`: Long,`height`: Long, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_client_get_notification_settings(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_get_notification_settings(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_client_get_profile(`ptr`: Pointer,`userId`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_get_profile(`ptr`: Pointer,`userId`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_client_get_session_verification_controller(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_get_session_verification_controller(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_client_homeserver(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_homeserver(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_client_ignore_user(`ptr`: Pointer,`userId`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_ignore_user(`ptr`: Pointer,`userId`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_client_login(`ptr`: Pointer,`username`: RustBuffer.ByValue,`password`: RustBuffer.ByValue,`initialDeviceName`: RustBuffer.ByValue,`deviceId`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_login(`ptr`: Pointer,`username`: RustBuffer.ByValue,`password`: RustBuffer.ByValue,`initialDeviceName`: RustBuffer.ByValue,`deviceId`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_client_logout(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_logout(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_client_notification_client(`ptr`: Pointer,`processSetup`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_notification_client(`ptr`: Pointer,`processSetup`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_client_remove_avatar(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_remove_avatar(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_client_restore_session(`ptr`: Pointer,`session`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_restore_session(`ptr`: Pointer,`session`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_client_rooms(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_rooms(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_client_search_users(`ptr`: Pointer,`searchTerm`: RustBuffer.ByValue,`limit`: Long,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_search_users(`ptr`: Pointer,`searchTerm`: RustBuffer.ByValue,`limit`: Long,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_client_session(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_session(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_client_set_account_data(`ptr`: Pointer,`eventType`: RustBuffer.ByValue,`content`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_set_account_data(`ptr`: Pointer,`eventType`: RustBuffer.ByValue,`content`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_client_set_delegate(`ptr`: Pointer,`delegate`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_set_delegate(`ptr`: Pointer,`delegate`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_client_set_display_name(`ptr`: Pointer,`name`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_set_display_name(`ptr`: Pointer,`name`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_client_set_pusher(`ptr`: Pointer,`identifiers`: RustBuffer.ByValue,`kind`: RustBuffer.ByValue,`appDisplayName`: RustBuffer.ByValue,`deviceDisplayName`: RustBuffer.ByValue,`profileTag`: RustBuffer.ByValue,`lang`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_set_pusher(`ptr`: Pointer,`identifiers`: RustBuffer.ByValue,`kind`: RustBuffer.ByValue,`appDisplayName`: RustBuffer.ByValue,`deviceDisplayName`: RustBuffer.ByValue,`profileTag`: RustBuffer.ByValue,`lang`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_client_sync_service(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_sync_service(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_client_unignore_user(`ptr`: Pointer,`userId`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_unignore_user(`ptr`: Pointer,`userId`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_client_upload_avatar(`ptr`: Pointer,`mimeType`: RustBuffer.ByValue,`data`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_upload_avatar(`ptr`: Pointer,`mimeType`: RustBuffer.ByValue,`data`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_matrix_sdk_ffi_fn_method_client_upload_media(`ptr`: Pointer,`mimeType`: RustBuffer.ByValue,`data`: RustBuffer.ByValue,`progressWatcher`: RustBuffer.ByValue, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_client_user_id(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_client_user_id(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_clone_clientbuilder(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_clientbuilder(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_clientbuilder(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_clientbuilder(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_constructor_clientbuilder_new(_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_constructor_clientbuilder_new(uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_base_path(`ptr`: Pointer,`path`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_base_path(`ptr`: Pointer,`path`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_build(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_build(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_disable_automatic_token_refresh(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_disable_automatic_token_refresh(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_disable_ssl_verification(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_disable_ssl_verification(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_enable_cross_process_refresh_lock(`ptr`: Pointer,`processId`: RustBuffer.ByValue,`sessionDelegate`: Long,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_enable_cross_process_refresh_lock(`ptr`: Pointer,`processId`: RustBuffer.ByValue,`sessionDelegate`: Long,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_homeserver_url(`ptr`: Pointer,`url`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_homeserver_url(`ptr`: Pointer,`url`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_passphrase(`ptr`: Pointer,`passphrase`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_passphrase(`ptr`: Pointer,`passphrase`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_proxy(`ptr`: Pointer,`url`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_proxy(`ptr`: Pointer,`url`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_server_name(`ptr`: Pointer,`serverName`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_server_name(`ptr`: Pointer,`serverName`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_server_versions(`ptr`: Pointer,`versions`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_server_versions(`ptr`: Pointer,`versions`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_set_session_delegate(`ptr`: Pointer,`sessionDelegate`: Long,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_set_session_delegate(`ptr`: Pointer,`sessionDelegate`: Long,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_sliding_sync_proxy(`ptr`: Pointer,`slidingSyncProxy`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_sliding_sync_proxy(`ptr`: Pointer,`slidingSyncProxy`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_user_agent(`ptr`: Pointer,`userAgent`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_user_agent(`ptr`: Pointer,`userAgent`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_username(`ptr`: Pointer,`username`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_username(`ptr`: Pointer,`username`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_clone_encryption(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_encryption(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_encryption(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_encryption(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_matrix_sdk_ffi_fn_method_encryption_backup_exists_on_server(`ptr`: Pointer, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_encryption_backup_state(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_encryption_backup_state(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_encryption_backup_state_listener(`ptr`: Pointer,`listener`: Long,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_encryption_backup_state_listener(`ptr`: Pointer,`listener`: Long,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_encryption_disable_recovery(`ptr`: Pointer, ): Pointer @@ -572,99 +577,99 @@ internal interface _UniFFILib : Library { ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_encryption_recover_and_reset(`ptr`: Pointer,`oldRecoveryKey`: RustBuffer.ByValue, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_encryption_recovery_state(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_encryption_recovery_state(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_encryption_recovery_state_listener(`ptr`: Pointer,`listener`: Long,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_encryption_recovery_state_listener(`ptr`: Pointer,`listener`: Long,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_encryption_reset_recovery_key(`ptr`: Pointer, ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_encryption_wait_for_backup_upload_steady_state(`ptr`: Pointer,`progressListener`: RustBuffer.ByValue, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_clone_eventtimelineitem(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_eventtimelineitem(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_eventtimelineitem(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_eventtimelineitem(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_can_be_replied_to(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_can_be_replied_to(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_content(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_content(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_debug_info(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_debug_info(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_event_id(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_event_id(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_is_editable(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_is_editable(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_is_local(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_is_local(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_is_own(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_is_own(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_is_remote(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_is_remote(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_local_send_state(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_local_send_state(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_origin(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_origin(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_reactions(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_reactions(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_read_receipts(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_read_receipts(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_sender(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_sender(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_sender_profile(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_sender_profile(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_timestamp(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_timestamp(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Long - fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_transaction_id(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_transaction_id(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_clone_homeserverlogindetails(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_homeserverlogindetails(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_homeserverlogindetails(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_homeserverlogindetails(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_homeserverlogindetails_supports_oidc_login(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_homeserverlogindetails_supports_oidc_login(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_homeserverlogindetails_supports_password_login(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_homeserverlogindetails_supports_password_login(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_homeserverlogindetails_url(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_homeserverlogindetails_url(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_clone_mediafilehandle(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_mediafilehandle(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_mediafilehandle(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_mediafilehandle(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_mediafilehandle_path(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_mediafilehandle_path(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_mediafilehandle_persist(`ptr`: Pointer,`path`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_mediafilehandle_persist(`ptr`: Pointer,`path`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_clone_message(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_message(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_message(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_message(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_message_body(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_message_body(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_message_in_reply_to(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_message_in_reply_to(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_message_is_edited(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_message_is_edited(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_message_is_threaded(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_message_is_threaded(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_message_msgtype(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_message_msgtype(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_clone_notificationclient(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_notificationclient(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_notificationclient(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_notificationclient(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_notificationclient_get_notification(`ptr`: Pointer,`roomId`: RustBuffer.ByValue,`eventId`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_notificationclient_get_notification(`ptr`: Pointer,`roomId`: RustBuffer.ByValue,`eventId`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_clone_notificationclientbuilder(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_notificationclientbuilder(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_notificationclientbuilder(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_notificationclientbuilder(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_notificationclientbuilder_filter_by_push_rules(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_notificationclientbuilder_filter_by_push_rules(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_notificationclientbuilder_finish(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_notificationclientbuilder_finish(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_clone_notificationsettings(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_notificationsettings(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_notificationsettings(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_notificationsettings(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_matrix_sdk_ffi_fn_method_notificationsettings_can_push_encrypted_event_to_device(`ptr`: Pointer, ): Pointer @@ -692,7 +697,7 @@ internal interface _UniFFILib : Library { ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_notificationsettings_set_default_room_notification_mode(`ptr`: Pointer,`isEncrypted`: Byte,`isOneToOne`: Byte,`mode`: RustBuffer.ByValue, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_notificationsettings_set_delegate(`ptr`: Pointer,`delegate`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_notificationsettings_set_delegate(`ptr`: Pointer,`delegate`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_matrix_sdk_ffi_fn_method_notificationsettings_set_invite_for_me_enabled(`ptr`: Pointer,`enabled`: Byte, ): Pointer @@ -704,23 +709,23 @@ internal interface _UniFFILib : Library { ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_notificationsettings_unmute_room(`ptr`: Pointer,`roomId`: RustBuffer.ByValue,`isEncrypted`: Byte,`isOneToOne`: Byte, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_clone_oidcauthenticationdata(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_oidcauthenticationdata(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_oidcauthenticationdata(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_oidcauthenticationdata(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_oidcauthenticationdata_login_url(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_oidcauthenticationdata_login_url(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_clone_room(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_room(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_room(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_room(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_room_active_members_count(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_active_members_count(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Long - fun uniffi_matrix_sdk_ffi_fn_method_room_active_room_call_participants(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_active_room_call_participants(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_room_alternative_aliases(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_alternative_aliases(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_room_avatar_url(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_avatar_url(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_matrix_sdk_ffi_fn_method_room_ban_user(`ptr`: Pointer,`userId`: RustBuffer.ByValue,`reason`: RustBuffer.ByValue, ): Pointer @@ -740,135 +745,135 @@ internal interface _UniFFILib : Library { ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_room_can_user_trigger_room_notification(`ptr`: Pointer,`userId`: RustBuffer.ByValue, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_room_canonical_alias(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_canonical_alias(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_room_display_name(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_display_name(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_room_has_active_room_call(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_has_active_room_call(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_room_id(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_id(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_room_ignore_user(`ptr`: Pointer,`userId`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_ignore_user(`ptr`: Pointer,`userId`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_room_invite_user_by_id(`ptr`: Pointer,`userId`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_invite_user_by_id(`ptr`: Pointer,`userId`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_room_invited_members_count(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_invited_members_count(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Long - fun uniffi_matrix_sdk_ffi_fn_method_room_inviter(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_inviter(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_room_is_direct(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_is_direct(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_room_is_encrypted(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_is_encrypted(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_room_is_public(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_is_public(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_room_is_space(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_is_space(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_room_is_tombstoned(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_is_tombstoned(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_room_join(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_join(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_room_joined_members_count(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_joined_members_count(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Long fun uniffi_matrix_sdk_ffi_fn_method_room_kick_user(`ptr`: Pointer,`userId`: RustBuffer.ByValue,`reason`: RustBuffer.ByValue, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_room_leave(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_leave(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_matrix_sdk_ffi_fn_method_room_member(`ptr`: Pointer,`userId`: RustBuffer.ByValue, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_room_member_avatar_url(`ptr`: Pointer,`userId`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_member_avatar_url(`ptr`: Pointer,`userId`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_room_member_display_name(`ptr`: Pointer,`userId`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_member_display_name(`ptr`: Pointer,`userId`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_matrix_sdk_ffi_fn_method_room_members(`ptr`: Pointer, ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_room_members_no_sync(`ptr`: Pointer, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_room_membership(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_membership(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_room_name(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_name(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_room_own_user_id(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_own_user_id(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_matrix_sdk_ffi_fn_method_room_poll_history(`ptr`: Pointer, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_room_redact(`ptr`: Pointer,`eventId`: RustBuffer.ByValue,`reason`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_redact(`ptr`: Pointer,`eventId`: RustBuffer.ByValue,`reason`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_room_remove_avatar(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_remove_avatar(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_room_report_content(`ptr`: Pointer,`eventId`: RustBuffer.ByValue,`score`: RustBuffer.ByValue,`reason`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_report_content(`ptr`: Pointer,`eventId`: RustBuffer.ByValue,`score`: RustBuffer.ByValue,`reason`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_matrix_sdk_ffi_fn_method_room_room_info(`ptr`: Pointer, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_room_set_name(`ptr`: Pointer,`name`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_set_name(`ptr`: Pointer,`name`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_room_set_topic(`ptr`: Pointer,`topic`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_set_topic(`ptr`: Pointer,`topic`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_room_subscribe_to_room_info_updates(`ptr`: Pointer,`listener`: Long,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_subscribe_to_room_info_updates(`ptr`: Pointer,`listener`: Long,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_room_timeline(`ptr`: Pointer, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_room_topic(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_topic(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_matrix_sdk_ffi_fn_method_room_typing_notice(`ptr`: Pointer,`isTyping`: Byte, ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_room_unban_user(`ptr`: Pointer,`userId`: RustBuffer.ByValue,`reason`: RustBuffer.ByValue, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_room_upload_avatar(`ptr`: Pointer,`mimeType`: RustBuffer.ByValue,`data`: RustBuffer.ByValue,`mediaInfo`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_room_upload_avatar(`ptr`: Pointer,`mimeType`: RustBuffer.ByValue,`data`: RustBuffer.ByValue,`mediaInfo`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_clone_roomlist(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_roomlist(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_roomlist(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_roomlist(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_roomlist_entries(`ptr`: Pointer,`listener`: Long,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roomlist_entries(`ptr`: Pointer,`listener`: Long,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_roomlist_entries_with_dynamic_adapters(`ptr`: Pointer,`pageSize`: Int,`listener`: Long,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roomlist_entries_with_dynamic_adapters(`ptr`: Pointer,`pageSize`: Int,`listener`: Long,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_roomlist_loading_state(`ptr`: Pointer,`listener`: Long,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roomlist_loading_state(`ptr`: Pointer,`listener`: Long,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_roomlist_room(`ptr`: Pointer,`roomId`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roomlist_room(`ptr`: Pointer,`roomId`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_clone_roomlistdynamicentriescontroller(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_roomlistdynamicentriescontroller(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_roomlistdynamicentriescontroller(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_roomlistdynamicentriescontroller(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_roomlistdynamicentriescontroller_add_one_page(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roomlistdynamicentriescontroller_add_one_page(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_roomlistdynamicentriescontroller_reset_to_one_page(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roomlistdynamicentriescontroller_reset_to_one_page(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_roomlistdynamicentriescontroller_set_filter(`ptr`: Pointer,`kind`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roomlistdynamicentriescontroller_set_filter(`ptr`: Pointer,`kind`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_clone_roomlistitem(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_roomlistitem(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_roomlistitem(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_roomlistitem(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_roomlistitem_avatar_url(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roomlistitem_avatar_url(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_roomlistitem_canonical_alias(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roomlistitem_canonical_alias(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_matrix_sdk_ffi_fn_method_roomlistitem_full_room(`ptr`: Pointer, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_roomlistitem_has_unread_notifications(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roomlistitem_has_unread_notifications(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_roomlistitem_id(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roomlistitem_id(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_roomlistitem_is_direct(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roomlistitem_is_direct(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte fun uniffi_matrix_sdk_ffi_fn_method_roomlistitem_latest_event(`ptr`: Pointer, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_roomlistitem_name(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roomlistitem_name(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_matrix_sdk_ffi_fn_method_roomlistitem_room_info(`ptr`: Pointer, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_roomlistitem_subscribe(`ptr`: Pointer,`settings`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roomlistitem_subscribe(`ptr`: Pointer,`settings`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_roomlistitem_unread_notifications(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roomlistitem_unread_notifications(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_roomlistitem_unsubscribe(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roomlistitem_unsubscribe(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_clone_roomlistservice(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_roomlistservice(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_roomlistservice(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_roomlistservice(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_matrix_sdk_ffi_fn_method_roomlistservice_all_rooms(`ptr`: Pointer, ): Pointer @@ -876,73 +881,73 @@ internal interface _UniFFILib : Library { ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_roomlistservice_invites(`ptr`: Pointer, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_roomlistservice_room(`ptr`: Pointer,`roomId`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roomlistservice_room(`ptr`: Pointer,`roomId`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_roomlistservice_state(`ptr`: Pointer,`listener`: Long,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roomlistservice_state(`ptr`: Pointer,`listener`: Long,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_roomlistservice_sync_indicator(`ptr`: Pointer,`delayBeforeShowingInMs`: Int,`delayBeforeHidingInMs`: Int,`listener`: Long,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roomlistservice_sync_indicator(`ptr`: Pointer,`delayBeforeShowingInMs`: Int,`delayBeforeHidingInMs`: Int,`listener`: Long,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_clone_roommember(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_roommember(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_roommember(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_roommember(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_roommember_avatar_url(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roommember_avatar_url(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_roommember_can_ban(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roommember_can_ban(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_roommember_can_invite(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roommember_can_invite(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_roommember_can_kick(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roommember_can_kick(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_roommember_can_redact_other(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roommember_can_redact_other(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_roommember_can_redact_own(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roommember_can_redact_own(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_roommember_can_send_message(`ptr`: Pointer,`event`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roommember_can_send_message(`ptr`: Pointer,`event`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_roommember_can_send_state(`ptr`: Pointer,`stateEvent`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roommember_can_send_state(`ptr`: Pointer,`stateEvent`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_roommember_can_trigger_room_notification(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roommember_can_trigger_room_notification(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_roommember_display_name(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roommember_display_name(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_roommember_ignore(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roommember_ignore(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_roommember_is_account_user(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roommember_is_account_user(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_roommember_is_ignored(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roommember_is_ignored(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_roommember_is_name_ambiguous(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roommember_is_name_ambiguous(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_roommember_membership(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roommember_membership(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_roommember_normalized_power_level(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roommember_normalized_power_level(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Long - fun uniffi_matrix_sdk_ffi_fn_method_roommember_power_level(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roommember_power_level(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Long - fun uniffi_matrix_sdk_ffi_fn_method_roommember_unignore(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roommember_unignore(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_roommember_user_id(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roommember_user_id(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_clone_roommembersiterator(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_roommembersiterator(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_roommembersiterator(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_roommembersiterator(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_roommembersiterator_len(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roommembersiterator_len(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Int - fun uniffi_matrix_sdk_ffi_fn_method_roommembersiterator_next_chunk(`ptr`: Pointer,`chunkSize`: Int,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_roommembersiterator_next_chunk(`ptr`: Pointer,`chunkSize`: Int,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_clone_sendattachmentjoinhandle(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_sendattachmentjoinhandle(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_sendattachmentjoinhandle(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_sendattachmentjoinhandle(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_sendattachmentjoinhandle_cancel(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_sendattachmentjoinhandle_cancel(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_matrix_sdk_ffi_fn_method_sendattachmentjoinhandle_join(`ptr`: Pointer, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_clone_sessionverificationcontroller(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_sessionverificationcontroller(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_sessionverificationcontroller(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_sessionverificationcontroller(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_matrix_sdk_ffi_fn_method_sessionverificationcontroller_approve_verification(`ptr`: Pointer, ): Pointer @@ -954,185 +959,185 @@ internal interface _UniFFILib : Library { ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_sessionverificationcontroller_request_verification(`ptr`: Pointer, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_sessionverificationcontroller_set_delegate(`ptr`: Pointer,`delegate`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_sessionverificationcontroller_set_delegate(`ptr`: Pointer,`delegate`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_matrix_sdk_ffi_fn_method_sessionverificationcontroller_start_sas_verification(`ptr`: Pointer, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_clone_sessionverificationemoji(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_sessionverificationemoji(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_sessionverificationemoji(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_sessionverificationemoji(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_sessionverificationemoji_description(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_sessionverificationemoji_description(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_sessionverificationemoji_symbol(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_sessionverificationemoji_symbol(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_clone_span(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_span(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_span(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_span(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_constructor_span_current(_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_constructor_span_current(uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_constructor_span_new(`file`: RustBuffer.ByValue,`line`: RustBuffer.ByValue,`level`: RustBuffer.ByValue,`target`: RustBuffer.ByValue,`name`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_constructor_span_new(`file`: RustBuffer.ByValue,`line`: RustBuffer.ByValue,`level`: RustBuffer.ByValue,`target`: RustBuffer.ByValue,`name`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_span_enter(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_span_enter(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_span_exit(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_span_exit(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_span_is_none(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_span_is_none(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_clone_syncservice(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_syncservice(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_syncservice(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_syncservice(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_syncservice_room_list_service(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_syncservice_room_list_service(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_syncservice_start(`ptr`: Pointer, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_syncservice_state(`ptr`: Pointer,`listener`: Long,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_syncservice_state(`ptr`: Pointer,`listener`: Long,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_syncservice_stop(`ptr`: Pointer, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_clone_syncservicebuilder(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_syncservicebuilder(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_syncservicebuilder(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_syncservicebuilder(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_matrix_sdk_ffi_fn_method_syncservicebuilder_finish(`ptr`: Pointer, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_syncservicebuilder_with_cross_process_lock(`ptr`: Pointer,`appIdentifier`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_syncservicebuilder_with_cross_process_lock(`ptr`: Pointer,`appIdentifier`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_clone_taskhandle(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_taskhandle(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_taskhandle(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_taskhandle(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_taskhandle_cancel(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_taskhandle_cancel(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_taskhandle_is_finished(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_taskhandle_is_finished(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_clone_timeline(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_timeline(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_timeline(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_timeline(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_matrix_sdk_ffi_fn_method_timeline_add_listener(`ptr`: Pointer,`listener`: Long, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_timeline_cancel_send(`ptr`: Pointer,`txnId`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timeline_cancel_send(`ptr`: Pointer,`txnId`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_timeline_create_poll(`ptr`: Pointer,`question`: RustBuffer.ByValue,`answers`: RustBuffer.ByValue,`maxSelections`: Byte,`pollKind`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timeline_create_poll(`ptr`: Pointer,`question`: RustBuffer.ByValue,`answers`: RustBuffer.ByValue,`maxSelections`: Byte,`pollKind`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_timeline_edit(`ptr`: Pointer,`newContent`: Pointer,`editItem`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timeline_edit(`ptr`: Pointer,`newContent`: Pointer,`editItem`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_matrix_sdk_ffi_fn_method_timeline_edit_poll(`ptr`: Pointer,`question`: RustBuffer.ByValue,`answers`: RustBuffer.ByValue,`maxSelections`: Byte,`pollKind`: RustBuffer.ByValue,`editItem`: Pointer, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_timeline_end_poll(`ptr`: Pointer,`pollStartId`: RustBuffer.ByValue,`text`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timeline_end_poll(`ptr`: Pointer,`pollStartId`: RustBuffer.ByValue,`text`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_timeline_fetch_details_for_event(`ptr`: Pointer,`eventId`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timeline_fetch_details_for_event(`ptr`: Pointer,`eventId`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_matrix_sdk_ffi_fn_method_timeline_fetch_members(`ptr`: Pointer, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_timeline_get_event_timeline_item_by_event_id(`ptr`: Pointer,`eventId`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timeline_get_event_timeline_item_by_event_id(`ptr`: Pointer,`eventId`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_timeline_get_timeline_event_content_by_event_id(`ptr`: Pointer,`eventId`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timeline_get_timeline_event_content_by_event_id(`ptr`: Pointer,`eventId`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_timeline_paginate_backwards(`ptr`: Pointer,`opts`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timeline_paginate_backwards(`ptr`: Pointer,`opts`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_timeline_retry_decryption(`ptr`: Pointer,`sessionIds`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timeline_retry_decryption(`ptr`: Pointer,`sessionIds`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_timeline_retry_send(`ptr`: Pointer,`txnId`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timeline_retry_send(`ptr`: Pointer,`txnId`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_timeline_send(`ptr`: Pointer,`msg`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timeline_send(`ptr`: Pointer,`msg`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_timeline_send_audio(`ptr`: Pointer,`url`: RustBuffer.ByValue,`audioInfo`: RustBuffer.ByValue,`progressWatcher`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timeline_send_audio(`ptr`: Pointer,`url`: RustBuffer.ByValue,`audioInfo`: RustBuffer.ByValue,`progressWatcher`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_timeline_send_file(`ptr`: Pointer,`url`: RustBuffer.ByValue,`fileInfo`: RustBuffer.ByValue,`progressWatcher`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timeline_send_file(`ptr`: Pointer,`url`: RustBuffer.ByValue,`fileInfo`: RustBuffer.ByValue,`progressWatcher`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_timeline_send_image(`ptr`: Pointer,`url`: RustBuffer.ByValue,`thumbnailUrl`: RustBuffer.ByValue,`imageInfo`: RustBuffer.ByValue,`progressWatcher`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timeline_send_image(`ptr`: Pointer,`url`: RustBuffer.ByValue,`thumbnailUrl`: RustBuffer.ByValue,`imageInfo`: RustBuffer.ByValue,`progressWatcher`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_timeline_send_location(`ptr`: Pointer,`body`: RustBuffer.ByValue,`geoUri`: RustBuffer.ByValue,`description`: RustBuffer.ByValue,`zoomLevel`: RustBuffer.ByValue,`assetType`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timeline_send_location(`ptr`: Pointer,`body`: RustBuffer.ByValue,`geoUri`: RustBuffer.ByValue,`description`: RustBuffer.ByValue,`zoomLevel`: RustBuffer.ByValue,`assetType`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_timeline_send_poll_response(`ptr`: Pointer,`pollStartId`: RustBuffer.ByValue,`answers`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timeline_send_poll_response(`ptr`: Pointer,`pollStartId`: RustBuffer.ByValue,`answers`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_timeline_send_read_receipt(`ptr`: Pointer,`receiptType`: RustBuffer.ByValue,`eventId`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timeline_send_read_receipt(`ptr`: Pointer,`receiptType`: RustBuffer.ByValue,`eventId`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_timeline_send_reply(`ptr`: Pointer,`msg`: Pointer,`replyItem`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timeline_send_reply(`ptr`: Pointer,`msg`: Pointer,`replyItem`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_timeline_send_video(`ptr`: Pointer,`url`: RustBuffer.ByValue,`thumbnailUrl`: RustBuffer.ByValue,`videoInfo`: RustBuffer.ByValue,`progressWatcher`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timeline_send_video(`ptr`: Pointer,`url`: RustBuffer.ByValue,`thumbnailUrl`: RustBuffer.ByValue,`videoInfo`: RustBuffer.ByValue,`progressWatcher`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_timeline_send_voice_message(`ptr`: Pointer,`url`: RustBuffer.ByValue,`audioInfo`: RustBuffer.ByValue,`waveform`: RustBuffer.ByValue,`progressWatcher`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timeline_send_voice_message(`ptr`: Pointer,`url`: RustBuffer.ByValue,`audioInfo`: RustBuffer.ByValue,`waveform`: RustBuffer.ByValue,`progressWatcher`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_timeline_subscribe_to_back_pagination_status(`ptr`: Pointer,`listener`: Long,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timeline_subscribe_to_back_pagination_status(`ptr`: Pointer,`listener`: Long,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_method_timeline_toggle_reaction(`ptr`: Pointer,`eventId`: RustBuffer.ByValue,`key`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timeline_toggle_reaction(`ptr`: Pointer,`eventId`: RustBuffer.ByValue,`key`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_clone_timelinediff(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_timelinediff(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_timelinediff(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_timelinediff(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_timelinediff_append(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timelinediff_append(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_timelinediff_change(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timelinediff_change(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_timelinediff_insert(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timelinediff_insert(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_timelinediff_push_back(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timelinediff_push_back(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_timelinediff_push_front(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timelinediff_push_front(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_timelinediff_remove(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timelinediff_remove(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_timelinediff_reset(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timelinediff_reset(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_timelinediff_set(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timelinediff_set(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_clone_timelineevent(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_timelineevent(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_timelineevent(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_timelineevent(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_timelineevent_event_id(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timelineevent_event_id(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_timelineevent_event_type(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timelineevent_event_type(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_timelineevent_sender_id(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timelineevent_sender_id(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_timelineevent_timestamp(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timelineevent_timestamp(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Long - fun uniffi_matrix_sdk_ffi_fn_clone_timelineitem(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_timelineitem(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_timelineitem(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_timelineitem(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_timelineitem_as_event(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timelineitem_as_event(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_timelineitem_as_virtual(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timelineitem_as_virtual(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_timelineitem_fmt_debug(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timelineitem_fmt_debug(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_timelineitem_unique_id(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timelineitem_unique_id(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Long - fun uniffi_matrix_sdk_ffi_fn_clone_timelineitemcontent(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_timelineitemcontent(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_timelineitemcontent(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_timelineitemcontent(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_timelineitemcontent_as_message(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timelineitemcontent_as_message(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_method_timelineitemcontent_kind(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_timelineitemcontent_kind(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_clone_unreadnotificationscount(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_unreadnotificationscount(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_unreadnotificationscount(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_unreadnotificationscount(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_method_unreadnotificationscount_has_notifications(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_unreadnotificationscount_has_notifications(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte - fun uniffi_matrix_sdk_ffi_fn_method_unreadnotificationscount_highlight_count(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_unreadnotificationscount_highlight_count(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Int - fun uniffi_matrix_sdk_ffi_fn_method_unreadnotificationscount_notification_count(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_method_unreadnotificationscount_notification_count(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Int - fun uniffi_matrix_sdk_ffi_fn_clone_widgetdriver(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_widgetdriver(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_widgetdriver(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_widgetdriver(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_matrix_sdk_ffi_fn_method_widgetdriver_run(`ptr`: Pointer,`room`: Pointer,`capabilitiesProvider`: Long, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_clone_widgetdriverhandle(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_widgetdriverhandle(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_free_widgetdriverhandle(`ptr`: Pointer,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_free_widgetdriverhandle(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_matrix_sdk_ffi_fn_method_widgetdriverhandle_recv(`ptr`: Pointer, ): Pointer @@ -1174,43 +1179,43 @@ internal interface _UniFFILib : Library { ): Unit fun uniffi_matrix_sdk_ffi_fn_init_callback_widgetcapabilitiesprovider(`handle`: ForeignCallback, ): Unit - fun uniffi_matrix_sdk_ffi_fn_func_gen_transaction_id(_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_func_gen_transaction_id(uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_matrix_sdk_ffi_fn_func_generate_webview_url(`widgetSettings`: RustBuffer.ByValue,`room`: Pointer,`props`: RustBuffer.ByValue, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_func_get_element_call_required_permissions(_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_func_get_element_call_required_permissions(uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_func_log_event(`file`: RustBuffer.ByValue,`line`: RustBuffer.ByValue,`level`: RustBuffer.ByValue,`target`: RustBuffer.ByValue,`message`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_func_log_event(`file`: RustBuffer.ByValue,`line`: RustBuffer.ByValue,`level`: RustBuffer.ByValue,`target`: RustBuffer.ByValue,`message`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_func_make_widget_driver(`settings`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_func_make_widget_driver(`settings`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_func_media_source_from_url(`url`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_func_media_source_from_url(`url`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_func_message_event_content_from_html(`body`: RustBuffer.ByValue,`htmlBody`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_func_message_event_content_from_html(`body`: RustBuffer.ByValue,`htmlBody`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_func_message_event_content_from_html_as_emote(`body`: RustBuffer.ByValue,`htmlBody`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_func_message_event_content_from_html_as_emote(`body`: RustBuffer.ByValue,`htmlBody`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_func_message_event_content_from_markdown(`md`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_func_message_event_content_from_markdown(`md`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_func_message_event_content_from_markdown_as_emote(`md`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_func_message_event_content_from_markdown_as_emote(`md`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_func_message_event_content_new(`msgtype`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_func_message_event_content_new(`msgtype`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer - fun uniffi_matrix_sdk_ffi_fn_func_new_virtual_element_call_widget(`props`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_func_new_virtual_element_call_widget(`props`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_func_sdk_git_sha(_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_func_sdk_git_sha(uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun uniffi_matrix_sdk_ffi_fn_func_setup_otlp_tracing(`config`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_func_setup_otlp_tracing(`config`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun uniffi_matrix_sdk_ffi_fn_func_setup_tracing(`config`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_func_setup_tracing(`config`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun ffi_matrix_sdk_ffi_rustbuffer_alloc(`size`: Int,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ffi_rustbuffer_alloc(`size`: Int,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun ffi_matrix_sdk_ffi_rustbuffer_from_bytes(`bytes`: ForeignBytes.ByValue,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ffi_rustbuffer_from_bytes(`bytes`: ForeignBytes.ByValue,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun ffi_matrix_sdk_ffi_rustbuffer_free(`buf`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ffi_rustbuffer_free(`buf`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun ffi_matrix_sdk_ffi_rustbuffer_reserve(`buf`: RustBuffer.ByValue,`additional`: Int,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ffi_rustbuffer_reserve(`buf`: RustBuffer.ByValue,`additional`: Int,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun ffi_matrix_sdk_ffi_rust_future_poll_u8(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -1218,7 +1223,7 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ffi_rust_future_free_u8(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ffi_rust_future_complete_u8(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ffi_rust_future_complete_u8(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte fun ffi_matrix_sdk_ffi_rust_future_poll_i8(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -1226,7 +1231,7 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ffi_rust_future_free_i8(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ffi_rust_future_complete_i8(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ffi_rust_future_complete_i8(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte fun ffi_matrix_sdk_ffi_rust_future_poll_u16(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -1234,7 +1239,7 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ffi_rust_future_free_u16(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ffi_rust_future_complete_u16(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ffi_rust_future_complete_u16(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Short fun ffi_matrix_sdk_ffi_rust_future_poll_i16(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -1242,7 +1247,7 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ffi_rust_future_free_i16(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ffi_rust_future_complete_i16(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ffi_rust_future_complete_i16(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Short fun ffi_matrix_sdk_ffi_rust_future_poll_u32(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -1250,7 +1255,7 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ffi_rust_future_free_u32(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ffi_rust_future_complete_u32(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ffi_rust_future_complete_u32(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Int fun ffi_matrix_sdk_ffi_rust_future_poll_i32(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -1258,7 +1263,7 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ffi_rust_future_free_i32(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ffi_rust_future_complete_i32(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ffi_rust_future_complete_i32(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Int fun ffi_matrix_sdk_ffi_rust_future_poll_u64(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -1266,7 +1271,7 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ffi_rust_future_free_u64(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ffi_rust_future_complete_u64(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ffi_rust_future_complete_u64(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Long fun ffi_matrix_sdk_ffi_rust_future_poll_i64(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -1274,7 +1279,7 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ffi_rust_future_free_i64(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ffi_rust_future_complete_i64(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ffi_rust_future_complete_i64(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Long fun ffi_matrix_sdk_ffi_rust_future_poll_f32(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -1282,7 +1287,7 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ffi_rust_future_free_f32(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ffi_rust_future_complete_f32(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ffi_rust_future_complete_f32(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Float fun ffi_matrix_sdk_ffi_rust_future_poll_f64(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -1290,7 +1295,7 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ffi_rust_future_free_f64(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ffi_rust_future_complete_f64(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ffi_rust_future_complete_f64(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Double fun ffi_matrix_sdk_ffi_rust_future_poll_pointer(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -1298,7 +1303,7 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ffi_rust_future_free_pointer(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ffi_rust_future_complete_pointer(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ffi_rust_future_complete_pointer(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -1306,7 +1311,7 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun ffi_matrix_sdk_ffi_rust_future_poll_void(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -1314,7 +1319,7 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ffi_rust_future_free_void(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ffi_rust_future_complete_void(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ffi_rust_future_complete_void(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit fun uniffi_matrix_sdk_ffi_checksum_func_gen_transaction_id( ): Short @@ -1983,7 +1988,7 @@ internal interface _UniFFILib : Library { } -private fun uniffiCheckContractApiVersion(lib: _UniFFILib) { +private fun uniffiCheckContractApiVersion(lib: UniffiLib) { // Get the bindings contract version from our ComponentInterface val bindings_contract_version = 25 // Get the scaffolding contract version by calling the into the dylib @@ -1994,11 +1999,11 @@ private fun uniffiCheckContractApiVersion(lib: _UniFFILib) { } @Suppress("UNUSED_PARAMETER") -private fun uniffiCheckApiChecksums(lib: _UniFFILib) { +private fun uniffiCheckApiChecksums(lib: UniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_func_gen_transaction_id() != 15808.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_func_generate_webview_url() != 61769.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_func_generate_webview_url() != 16579.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_func_get_element_call_required_permissions() != 30886.toShort()) { @@ -2010,22 +2015,22 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_func_make_widget_driver() != 11382.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_func_media_source_from_url() != 34181.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_func_media_source_from_url() != 33587.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_func_message_event_content_from_html() != 20326.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_func_message_event_content_from_html() != 34215.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_func_message_event_content_from_html_as_emote() != 6795.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_func_message_event_content_from_html_as_emote() != 21632.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_func_message_event_content_from_markdown() != 1331.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_func_message_event_content_from_markdown() != 7130.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_func_message_event_content_from_markdown_as_emote() != 34066.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_func_message_event_content_from_markdown_as_emote() != 7466.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_func_message_event_content_new() != 9639.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_func_message_event_content_new() != 31683.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_func_new_virtual_element_call_widget() != 39901.toShort()) { @@ -2052,16 +2057,16 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_authenticationservice_configure_homeserver() != 39888.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_authenticationservice_homeserver_details() != 2340.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_authenticationservice_homeserver_details() != 39542.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_authenticationservice_login() != 35422.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_authenticationservice_login() != 50794.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_authenticationservice_login_with_oidc_callback() != 47183.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_authenticationservice_login_with_oidc_callback() != 32717.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_authenticationservice_url_for_oidc_login() != 26250.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_authenticationservice_url_for_oidc_login() != 47926.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_account_data() != 42952.toShort()) { @@ -2085,28 +2090,28 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_display_name() != 31680.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_encryption() != 41271.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_encryption() != 9657.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_get_dm_room() != 39967.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_get_dm_room() != 55850.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_get_media_content() != 40308.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_get_media_content() != 40597.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_get_media_file() != 46474.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_get_media_file() != 37676.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_get_media_thumbnail() != 12239.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_get_media_thumbnail() != 29639.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_get_notification_settings() != 8178.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_get_notification_settings() != 6359.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_get_profile() != 54768.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_get_session_verification_controller() != 12447.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_get_session_verification_controller() != 62335.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_homeserver() != 26427.toShort()) { @@ -2121,7 +2126,7 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_logout() != 7127.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_notification_client() != 15396.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_notification_client() != 49891.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_remove_avatar() != 60365.toShort()) { @@ -2130,7 +2135,7 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_restore_session() != 19641.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_rooms() != 1535.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_rooms() != 29558.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_search_users() != 30416.toShort()) { @@ -2142,7 +2147,7 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_set_account_data() != 52207.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_set_delegate() != 32764.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_set_delegate() != 13852.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_set_display_name() != 27968.toShort()) { @@ -2151,7 +2156,7 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_set_pusher() != 36816.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_sync_service() != 42759.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_sync_service() != 52812.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_unignore_user() != 11337.toShort()) { @@ -2166,46 +2171,46 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_user_id() != 40531.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_base_path() != 62481.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_base_path() != 40888.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_build() != 60680.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_build() != 25537.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_disable_automatic_token_refresh() != 23631.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_disable_automatic_token_refresh() != 43839.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_disable_ssl_verification() != 40001.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_disable_ssl_verification() != 2334.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_enable_cross_process_refresh_lock() != 35130.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_enable_cross_process_refresh_lock() != 23732.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_homeserver_url() != 25144.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_homeserver_url() != 30130.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_passphrase() != 45705.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_passphrase() != 47878.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_proxy() != 6361.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_proxy() != 34543.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_server_name() != 57874.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_server_name() != 63110.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_server_versions() != 48803.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_server_versions() != 36178.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_set_session_delegate() != 56110.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_set_session_delegate() != 37012.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_sliding_sync_proxy() != 28433.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_sliding_sync_proxy() != 40747.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_user_agent() != 49672.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_user_agent() != 35113.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_username() != 4442.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_username() != 30031.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_encryption_backup_exists_on_server() != 45490.toShort()) { @@ -2214,7 +2219,7 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_encryption_backup_state() != 51049.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_encryption_backup_state_listener() != 28653.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_encryption_backup_state_listener() != 42037.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_encryption_disable_recovery() != 18699.toShort()) { @@ -2238,7 +2243,7 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_encryption_recovery_state() != 54051.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_encryption_recovery_state_listener() != 226.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_encryption_recovery_state_listener() != 65018.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_encryption_reset_recovery_key() != 20380.toShort()) { @@ -2250,7 +2255,7 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_eventtimelineitem_can_be_replied_to() != 42922.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_eventtimelineitem_content() != 33114.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_eventtimelineitem_content() != 41060.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_eventtimelineitem_debug_info() != 31359.toShort()) { @@ -2328,10 +2333,10 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_notificationclient_get_notification() != 22643.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_notificationclientbuilder_filter_by_push_rules() != 19285.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_notificationclientbuilder_filter_by_push_rules() != 20013.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_notificationclientbuilder_finish() != 39352.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_notificationclientbuilder_finish() != 40007.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_notificationsettings_can_push_encrypted_event_to_device() != 21251.toShort()) { @@ -2454,7 +2459,7 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_invited_members_count() != 1023.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_inviter() != 21861.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_inviter() != 59542.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_is_direct() != 16947.toShort()) { @@ -2484,7 +2489,7 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_leave() != 6569.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_member() != 23757.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_member() != 10689.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_member_avatar_url() != 42670.toShort()) { @@ -2493,10 +2498,10 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_member_display_name() != 25496.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_members() != 2783.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_members() != 42691.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_members_no_sync() != 693.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_members_no_sync() != 3255.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_membership() != 26065.toShort()) { @@ -2508,7 +2513,7 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_own_user_id() != 39510.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_poll_history() != 12017.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_poll_history() != 1091.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_redact() != 55672.toShort()) { @@ -2529,10 +2534,10 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_set_topic() != 29413.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_subscribe_to_room_info_updates() != 64783.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_subscribe_to_room_info_updates() != 47774.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_timeline() != 57790.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_timeline() != 57169.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_topic() != 59745.toShort()) { @@ -2556,7 +2561,7 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlist_loading_state() != 53222.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlist_room() != 13228.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlist_room() != 21437.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistdynamicentriescontroller_add_one_page() != 47748.toShort()) { @@ -2574,7 +2579,7 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistitem_canonical_alias() != 63300.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistitem_full_room() != 45898.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistitem_full_room() != 12378.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistitem_has_unread_notifications() != 49961.toShort()) { @@ -2586,7 +2591,7 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistitem_is_direct() != 46873.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistitem_latest_event() != 35232.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistitem_latest_event() != 41471.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistitem_name() != 6516.toShort()) { @@ -2598,28 +2603,28 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistitem_subscribe() != 19882.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistitem_unread_notifications() != 57102.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistitem_unread_notifications() != 23977.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistitem_unsubscribe() != 45026.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistservice_all_rooms() != 39366.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistservice_all_rooms() != 49704.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistservice_apply_input() != 63125.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistservice_invites() != 4719.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistservice_invites() != 18531.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistservice_room() != 61319.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistservice_room() != 63500.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistservice_state() != 20741.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistservice_state() != 49435.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistservice_sync_indicator() != 41816.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistservice_sync_indicator() != 50946.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_roommember_avatar_url() != 1477.toShort()) { @@ -2682,7 +2687,7 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_roommembersiterator_len() != 39835.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_roommembersiterator_next_chunk() != 40345.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_roommembersiterator_next_chunk() != 36918.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_sendattachmentjoinhandle_cancel() != 19759.toShort()) { @@ -2727,22 +2732,22 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_span_is_none() != 33327.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_syncservice_room_list_service() != 23375.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_syncservice_room_list_service() != 26426.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_syncservice_start() != 16010.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_syncservice_state() != 19149.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_syncservice_state() != 23660.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_syncservice_stop() != 23138.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_syncservicebuilder_finish() != 5363.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_syncservicebuilder_finish() != 22814.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_syncservicebuilder_with_cross_process_lock() != 51317.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_syncservicebuilder_with_cross_process_lock() != 43169.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_taskhandle_cancel() != 9124.toShort()) { @@ -2760,10 +2765,10 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_create_poll() != 19084.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_edit() != 9203.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_edit() != 30407.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_edit_poll() != 63431.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_edit_poll() != 52880.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_end_poll() != 27185.toShort()) { @@ -2775,10 +2780,10 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_fetch_members() != 37994.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_get_event_timeline_item_by_event_id() != 7562.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_get_event_timeline_item_by_event_id() != 33483.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_get_timeline_event_content_by_event_id() != 30164.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_get_timeline_event_content_by_event_id() != 33318.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_paginate_backwards() != 40762.toShort()) { @@ -2790,16 +2795,16 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_retry_send() != 31214.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_send() != 27762.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_send() != 16148.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_send_audio() != 1059.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_send_audio() != 51865.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_send_file() != 40329.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_send_file() != 14268.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_send_image() != 48807.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_send_image() != 48568.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_send_location() != 2150.toShort()) { @@ -2811,22 +2816,22 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_send_read_receipt() != 30808.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_send_reply() != 52530.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_send_reply() != 8317.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_send_video() != 10645.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_send_video() != 9937.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_send_voice_message() != 21069.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_send_voice_message() != 9768.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_subscribe_to_back_pagination_status() != 62236.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_subscribe_to_back_pagination_status() != 9015.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_toggle_reaction() != 42402.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_timelinediff_append() != 5672.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_timelinediff_append() != 8453.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_timelinediff_change() != 4562.toShort()) { @@ -2835,16 +2840,16 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_timelinediff_insert() != 26630.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_timelinediff_push_back() != 22999.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_timelinediff_push_back() != 53464.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_timelinediff_push_front() != 30427.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_timelinediff_push_front() != 42084.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_timelinediff_remove() != 74.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_timelinediff_reset() != 55990.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_timelinediff_reset() != 34118.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_timelinediff_set() != 13334.toShort()) { @@ -2862,7 +2867,7 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_timelineevent_timestamp() != 58123.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_timelineitem_as_event() != 14732.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_timelineitem_as_event() != 52211.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_timelineitem_as_virtual() != 50960.toShort()) { @@ -2874,7 +2879,7 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_timelineitem_unique_id() != 8639.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_timelineitemcontent_as_message() != 2693.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_timelineitemcontent_as_message() != 45784.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_timelineitemcontent_kind() != 44789.toShort()) { @@ -2889,7 +2894,7 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_unreadnotificationscount_notification_count() != 35655.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_widgetdriver_run() != 9390.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_widgetdriver_run() != 6150.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_widgetdriverhandle_recv() != 2662.toShort()) { @@ -2901,16 +2906,16 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_constructor_mediasource_from_json() != 62542.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_constructor_authenticationservice_new() != 25316.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_constructor_authenticationservice_new() != 1456.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_constructor_clientbuilder_new() != 55408.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_constructor_clientbuilder_new() != 43131.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_constructor_span_current() != 7835.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_constructor_span_current() != 65184.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_constructor_span_new() != 44123.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_constructor_span_new() != 62579.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_backpaginationstatuslistener_on_update() != 5891.toShort()) { @@ -2982,7 +2987,7 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_syncservicestateobserver_on_update() != 11758.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_timelinelistener_on_update() != 30147.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_timelinelistener_on_update() != 9224.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_widgetcapabilitiesprovider_acquire_capabilities() != 43759.toShort()) { @@ -3008,10 +3013,10 @@ internal object uniffiRustFutureContinuationCallback: UniFffiRustFutureContinuat internal suspend fun uniffiRustCallAsync( rustFuture: Pointer, pollFunc: (Pointer, UniFffiRustFutureContinuationCallbackType, USize) -> Unit, - completeFunc: (Pointer, RustCallStatus) -> F, + completeFunc: (Pointer, UniffiRustCallStatus) -> F, freeFunc: (Pointer) -> Unit, liftFunc: (F) -> T, - errorHandler: CallStatusErrorHandler + errorHandler: UniffiRustCallStatusErrorHandler ): T { try { do { @@ -3025,7 +3030,7 @@ internal suspend fun uniffiRustCallAsync( } while (pollResult != UNIFFI_RUST_FUTURE_POLL_READY); return liftFunc( - rustCallWithError(errorHandler, { status -> completeFunc(rustFuture, status) }) + uniffiRustCallWithError(errorHandler, { status -> completeFunc(rustFuture, status) }) ) } finally { freeFunc(rustFuture) @@ -3335,6 +3340,66 @@ public object FfiConverterDuration: FfiConverterRustBuffer { +// The cleaner interface for Object finalization code to run. +// This is the entry point to any implementation that we're using. +// +// The cleaner registers objects and returns cleanables, so now we are +// defining a `UniffiCleaner` with a `UniffiClenaer.Cleanable` to abstract the +// different implmentations available at compile time. +interface UniffiCleaner { + interface Cleanable { + fun clean() + } + + 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() + + override fun register(value: Any, cleanUpTask: Runnable): UniffiCleaner.Cleanable = + UniffiJnaCleanable(cleaner.register(value, cleanUpTask)) +} + +private class UniffiJnaCleanable( + private val cleanable: com.sun.jna.internal.Cleaner.Cleanable, +) : UniffiCleaner.Cleanable { + override fun clean() = cleanable.clean() +} + +// We decide at uniffi binding generation time whether we were +// using Android or not. +// There are further runtime checks to chose the correct implementation +// of the cleaner. +private fun UniffiCleaner.Companion.create(): UniffiCleaner = + try { + // For safety's sake: if the library hasn't been run in android_cleaner = true + // mode, but is being run on Android, then we still need to think about + // Android API versions. + // So we check if java.lang.ref.Cleaner is there, and use that… + java.lang.Class.forName("java.lang.ref.Cleaner") + JavaLangRefCleaner() + } catch (e: ClassNotFoundException) { + // … otherwise, fallback to the JNA cleaner. + UniffiJnaCleaner() + } + +private class JavaLangRefCleaner : UniffiCleaner { + val cleaner = java.lang.ref.Cleaner.create() + + override fun register(value: Any, cleanUpTask: Runnable): UniffiCleaner.Cleanable = + JavaLangRefCleanable(cleaner.register(value, cleanUpTask)) +} + +private class JavaLangRefCleanable( + val cleanable: java.lang.ref.Cleaner.Cleanable +) : UniffiCleaner.Cleanable { + override fun clean() = cleanable.clean() +} + // The base class for all UniFFI Object types. // // This class provides core operations for working with the Rust `Arc` pointer to @@ -3354,8 +3419,8 @@ public object FfiConverterDuration: FfiConverterRustBuffer { // // * Given an `FFIObject` instance, calling code is expected to call the special // `destroy` method in order to free it after use, either by calling it explicitly -// or by using a higher-level helper like the `use` method. Failing to do so will -// leak the underlying Rust struct. +// or by using a higher-level helper like the `use` method. Failing to do so risks +// leaking the underlying Rust struct. // // * We can't assume that calling code will do the right thing, and must be prepared // to handle Kotlin method calls executing concurrently with or even after a call to @@ -3365,6 +3430,14 @@ public object FfiConverterDuration: FfiConverterRustBuffer { // the destructor has been called, and must never call the destructor more than once. // Doing so may trigger memory unsafety. // +// * To mitigate many of the risks of leaking memory and use-after-free unsafety, a `Cleaner` +// is implemented to call the destructor when the Kotlin object becomes unreachable. +// This is done in a background thread. This is not a panacea, and client code should be aware that +// 1. the thread may starve if some there are objects that have poorly performing +// `drop` methods or do significant work in their `drop` methods. +// 2. the thread is shared across the whole library. This can be tuned by using `android_cleaner = true`, +// or `android = true` in the [`kotlin` section of the `uniffi.toml` file](https://mozilla.github.io/uniffi-rs/kotlin/configuration.html). +// // If we try to implement this with mutual exclusion on access to the pointer, there is the // possibility of a race between a method call and a concurrent call to `destroy`: // @@ -3406,13 +3479,19 @@ public object FfiConverterDuration: FfiConverterRustBuffer { // called *and* all in-flight method calls have completed, avoiding violating any of the expectations // of the underlying Rust code. // -// In the future we may be able to replace some of this with automatic finalization logic, such as using -// the new "Cleaner" functionality in Java 9. The above scheme has been designed to work even if `destroy` is -// invoked by garbage-collection machinery rather than by calling code (which by the way, it's apparently also -// possible for the JVM to finalize an object while there is an in-flight call to one of its methods [1], -// so there would still be some complexity here). +// This makes a cleaner a better alternative to _not_ calling `destroy()` as +// and when the object is finished with, but the abstraction is not perfect: if the Rust object's `drop` +// method is slow, and/or there are many objects to cleanup, and it's on a low end Android device, then the cleaner +// thread may be starved, and the app will leak memory. +// +// In this case, `destroy`ing manually may be a better solution. // -// Sigh...all of this for want of a robust finalization mechanism. +// The cleaner can live side by side with the manual calling of `destroy`. In the order of responsiveness, uniffi objects +// with Rust peers are reclaimed: +// +// 1. By calling the `destroy` method of the object, which calls `rustObject.free()`. If that doesn't happen: +// 2. When the object becomes unreachable, AND the Cleaner thread gets to call `rustObject.free()`. If the thread is starved then: +// 3. The memory is reclaimed when the process terminates. // // [1] https://stackoverflow.com/questions/24376768/can-java-finalize-an-object-when-it-is-still-in-scope/24380219 // @@ -3436,15 +3515,11 @@ abstract class FFIObject: Disposable, AutoCloseable { } protected val pointer: Pointer? + protected abstract val cleanable: UniffiCleaner.Cleanable private val wasDestroyed = AtomicBoolean(false) private val callCounter = AtomicLong(1) - open protected fun freeRustArcPtr() { - // Overridden by generated subclasses, the default method exists to allow users to manually - // implement the interface - } - open fun uniffiClonePointer(): Pointer { // Overridden by generated subclasses, the default method exists to allow users to manually // implement the interface @@ -3457,7 +3532,7 @@ abstract class FFIObject: Disposable, AutoCloseable { if (this.wasDestroyed.compareAndSet(false, true)) { // This decrement always matches the initial count of 1 given at creation time. if (this.callCounter.decrementAndGet() == 0L) { - this.freeRustArcPtr() + cleanable.clean() } } } @@ -3485,7 +3560,7 @@ abstract class FFIObject: Disposable, AutoCloseable { } finally { // This decrement always matches the increment we performed above. if (this.callCounter.decrementAndGet() == 0L) { - this.freeRustArcPtr() + cleanable.clean() } } } @@ -3542,29 +3617,27 @@ open class AuthenticationService : FFIObject, AuthenticationServiceInterface { */ constructor(`basePath`: String, `passphrase`: String?, `userAgent`: String?, `oidcConfiguration`: OidcConfiguration?, `customSlidingSyncProxy`: String?, `sessionDelegate`: ClientSessionDelegate?, `crossProcessRefreshLockId`: String?) : this( - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_constructor_authenticationservice_new(FfiConverterString.lower(`basePath`),FfiConverterOptionalString.lower(`passphrase`),FfiConverterOptionalString.lower(`userAgent`),FfiConverterOptionalTypeOidcConfiguration.lower(`oidcConfiguration`),FfiConverterOptionalString.lower(`customSlidingSyncProxy`),FfiConverterOptionalTypeClientSessionDelegate.lower(`sessionDelegate`),FfiConverterOptionalString.lower(`crossProcessRefreshLockId`),_status) + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_constructor_authenticationservice_new(FfiConverterString.lower(`basePath`),FfiConverterOptionalString.lower(`passphrase`),FfiConverterOptionalString.lower(`userAgent`),FfiConverterOptionalTypeOidcConfiguration.lower(`oidcConfiguration`),FfiConverterOptionalString.lower(`customSlidingSyncProxy`),FfiConverterOptionalTypeClientSessionDelegate.lower(`sessionDelegate`),FfiConverterOptionalString.lower(`crossProcessRefreshLockId`),_status) }) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_authenticationservice(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_authenticationservice(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_authenticationservice(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_authenticationservice(pointer!!, status) } } @@ -3575,8 +3648,8 @@ open class AuthenticationService : FFIObject, AuthenticationServiceInterface { */ @Throws(AuthenticationException::class)override fun `configureHomeserver`(`serverNameOrHomeserverUrl`: String) = callWithPointer { - rustCallWithError(AuthenticationException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_authenticationservice_configure_homeserver(it, + uniffiRustCallWithError(AuthenticationException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_authenticationservice_configure_homeserver(it, FfiConverterString.lower(`serverNameOrHomeserverUrl`), _status) } @@ -3585,8 +3658,8 @@ open class AuthenticationService : FFIObject, AuthenticationServiceInterface { override fun `homeserverDetails`(): HomeserverLoginDetails? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_authenticationservice_homeserver_details(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_authenticationservice_homeserver_details(it, _status) } @@ -3600,8 +3673,8 @@ open class AuthenticationService : FFIObject, AuthenticationServiceInterface { */ @Throws(AuthenticationException::class)override fun `login`(`username`: String, `password`: String, `initialDeviceName`: String?, `deviceId`: String?): Client = callWithPointer { - rustCallWithError(AuthenticationException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_authenticationservice_login(it, + uniffiRustCallWithError(AuthenticationException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_authenticationservice_login(it, FfiConverterString.lower(`username`),FfiConverterString.lower(`password`),FfiConverterOptionalString.lower(`initialDeviceName`),FfiConverterOptionalString.lower(`deviceId`), _status) } @@ -3615,8 +3688,8 @@ open class AuthenticationService : FFIObject, AuthenticationServiceInterface { */ @Throws(AuthenticationException::class)override fun `loginWithOidcCallback`(`authenticationData`: OidcAuthenticationData, `callbackUrl`: String): Client = callWithPointer { - rustCallWithError(AuthenticationException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_authenticationservice_login_with_oidc_callback(it, + uniffiRustCallWithError(AuthenticationException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_authenticationservice_login_with_oidc_callback(it, FfiConverterTypeOidcAuthenticationData.lower(`authenticationData`),FfiConverterString.lower(`callbackUrl`), _status) } @@ -3632,8 +3705,8 @@ open class AuthenticationService : FFIObject, AuthenticationServiceInterface { */ @Throws(AuthenticationException::class)override fun `urlForOidcLogin`(): OidcAuthenticationData = callWithPointer { - rustCallWithError(AuthenticationException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_authenticationservice_url_for_oidc_login(it, + uniffiRustCallWithError(AuthenticationException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_authenticationservice_url_for_oidc_login(it, _status) } @@ -3791,25 +3864,23 @@ open class Client : FFIObject, ClientInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_client(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_client(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_client(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_client(pointer!!, status) } } @@ -3822,8 +3893,8 @@ open class Client : FFIObject, ClientInterface { */ @Throws(ClientException::class)override fun `accountData`(`eventType`: String): String? = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_account_data(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_account_data(it, FfiConverterString.lower(`eventType`), _status) } @@ -3834,8 +3905,8 @@ open class Client : FFIObject, ClientInterface { @Throws(ClientException::class)override fun `accountUrl`(`action`: AccountManagementAction?): String? = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_account_url(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_account_url(it, FfiConverterOptionalTypeAccountManagementAction.lower(`action`), _status) } @@ -3846,8 +3917,8 @@ open class Client : FFIObject, ClientInterface { @Throws(ClientException::class)override fun `avatarUrl`(): String? = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_avatar_url(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_avatar_url(it, _status) } @@ -3858,8 +3929,8 @@ open class Client : FFIObject, ClientInterface { @Throws(ClientException::class)override fun `cachedAvatarUrl`(): String? = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_cached_avatar_url(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_cached_avatar_url(it, _status) } @@ -3870,8 +3941,8 @@ open class Client : FFIObject, ClientInterface { @Throws(ClientException::class)override fun `createRoom`(`request`: CreateRoomParameters): String = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_create_room(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_create_room(it, FfiConverterTypeCreateRoomParameters.lower(`request`), _status) } @@ -3882,8 +3953,8 @@ open class Client : FFIObject, ClientInterface { @Throws(ClientException::class)override fun `deviceId`(): String = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_device_id(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_device_id(it, _status) } @@ -3894,8 +3965,8 @@ open class Client : FFIObject, ClientInterface { @Throws(ClientException::class)override fun `displayName`(): String = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_display_name(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_display_name(it, _status) } @@ -3905,8 +3976,8 @@ open class Client : FFIObject, ClientInterface { override fun `encryption`(): Encryption = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_encryption(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_encryption(it, _status) } @@ -3917,8 +3988,8 @@ open class Client : FFIObject, ClientInterface { @Throws(ClientException::class)override fun `getDmRoom`(`userId`: String): Room? = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_get_dm_room(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_get_dm_room(it, FfiConverterString.lower(`userId`), _status) } @@ -3932,14 +4003,14 @@ open class Client : FFIObject, ClientInterface { override suspend fun `getMediaContent`(`mediaSource`: MediaSource) : ByteArray { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_get_media_content( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_get_media_content( thisPtr, FfiConverterTypeMediaSource.lower(`mediaSource`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterByteArray.lift(it) }, // Error FFI converter @@ -3952,14 +4023,14 @@ open class Client : FFIObject, ClientInterface { override suspend fun `getMediaFile`(`mediaSource`: MediaSource, `body`: String?, `mimeType`: String, `useCache`: Boolean, `tempDir`: String?) : MediaFileHandle { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_get_media_file( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_get_media_file( thisPtr, FfiConverterTypeMediaSource.lower(`mediaSource`),FfiConverterOptionalString.lower(`body`),FfiConverterString.lower(`mimeType`),FfiConverterBoolean.lower(`useCache`),FfiConverterOptionalString.lower(`tempDir`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, // lift function { FfiConverterTypeMediaFileHandle.lift(it) }, // Error FFI converter @@ -3972,14 +4043,14 @@ open class Client : FFIObject, ClientInterface { override suspend fun `getMediaThumbnail`(`mediaSource`: MediaSource, `width`: ULong, `height`: ULong) : ByteArray { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_get_media_thumbnail( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_get_media_thumbnail( thisPtr, FfiConverterTypeMediaSource.lower(`mediaSource`),FfiConverterULong.lower(`width`),FfiConverterULong.lower(`height`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterByteArray.lift(it) }, // Error FFI converter @@ -3988,8 +4059,8 @@ open class Client : FFIObject, ClientInterface { } override fun `getNotificationSettings`(): NotificationSettings = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_get_notification_settings(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_get_notification_settings(it, _status) } @@ -4000,8 +4071,8 @@ open class Client : FFIObject, ClientInterface { @Throws(ClientException::class)override fun `getProfile`(`userId`: String): UserProfile = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_get_profile(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_get_profile(it, FfiConverterString.lower(`userId`), _status) } @@ -4012,8 +4083,8 @@ open class Client : FFIObject, ClientInterface { @Throws(ClientException::class)override fun `getSessionVerificationController`(): SessionVerificationController = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_get_session_verification_controller(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_get_session_verification_controller(it, _status) } @@ -4026,8 +4097,8 @@ open class Client : FFIObject, ClientInterface { * The homeserver this client is configured to use. */override fun `homeserver`(): String = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_homeserver(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_homeserver(it, _status) } @@ -4038,8 +4109,8 @@ open class Client : FFIObject, ClientInterface { @Throws(ClientException::class)override fun `ignoreUser`(`userId`: String) = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_ignore_user(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_ignore_user(it, FfiConverterString.lower(`userId`), _status) } @@ -4052,8 +4123,8 @@ open class Client : FFIObject, ClientInterface { */ @Throws(ClientException::class)override fun `login`(`username`: String, `password`: String, `initialDeviceName`: String?, `deviceId`: String?) = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_login(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_login(it, FfiConverterString.lower(`username`),FfiConverterString.lower(`password`),FfiConverterOptionalString.lower(`initialDeviceName`),FfiConverterOptionalString.lower(`deviceId`), _status) } @@ -4068,8 +4139,8 @@ open class Client : FFIObject, ClientInterface { */ @Throws(ClientException::class)override fun `logout`(): String? = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_logout(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_logout(it, _status) } @@ -4080,8 +4151,8 @@ open class Client : FFIObject, ClientInterface { @Throws(ClientException::class)override fun `notificationClient`(`processSetup`: NotificationProcessSetup): NotificationClientBuilder = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_notification_client(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_notification_client(it, FfiConverterTypeNotificationProcessSetup.lower(`processSetup`), _status) } @@ -4092,8 +4163,8 @@ open class Client : FFIObject, ClientInterface { @Throws(ClientException::class)override fun `removeAvatar`() = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_remove_avatar(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_remove_avatar(it, _status) } @@ -4106,8 +4177,8 @@ open class Client : FFIObject, ClientInterface { */ @Throws(ClientException::class)override fun `restoreSession`(`session`: Session) = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_restore_session(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_restore_session(it, FfiConverterTypeSession.lower(`session`), _status) } @@ -4116,8 +4187,8 @@ open class Client : FFIObject, ClientInterface { override fun `rooms`(): List = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_rooms(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_rooms(it, _status) } @@ -4128,8 +4199,8 @@ open class Client : FFIObject, ClientInterface { @Throws(ClientException::class)override fun `searchUsers`(`searchTerm`: String, `limit`: ULong): SearchUsersResults = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_search_users(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_search_users(it, FfiConverterString.lower(`searchTerm`),FfiConverterULong.lower(`limit`), _status) } @@ -4140,8 +4211,8 @@ open class Client : FFIObject, ClientInterface { @Throws(ClientException::class)override fun `session`(): Session = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_session(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_session(it, _status) } @@ -4157,8 +4228,8 @@ open class Client : FFIObject, ClientInterface { */ @Throws(ClientException::class)override fun `setAccountData`(`eventType`: String, `content`: String) = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_set_account_data(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_set_account_data(it, FfiConverterString.lower(`eventType`),FfiConverterString.lower(`content`), _status) } @@ -4167,8 +4238,8 @@ open class Client : FFIObject, ClientInterface { override fun `setDelegate`(`delegate`: ClientDelegate?): TaskHandle? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_set_delegate(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_set_delegate(it, FfiConverterOptionalTypeClientDelegate.lower(`delegate`), _status) } @@ -4179,8 +4250,8 @@ open class Client : FFIObject, ClientInterface { @Throws(ClientException::class)override fun `setDisplayName`(`name`: String) = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_set_display_name(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_set_display_name(it, FfiConverterString.lower(`name`), _status) } @@ -4193,8 +4264,8 @@ open class Client : FFIObject, ClientInterface { */ @Throws(ClientException::class)override fun `setPusher`(`identifiers`: PusherIdentifiers, `kind`: PusherKind, `appDisplayName`: String, `deviceDisplayName`: String, `profileTag`: String?, `lang`: String) = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_set_pusher(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_set_pusher(it, FfiConverterTypePusherIdentifiers.lower(`identifiers`),FfiConverterTypePusherKind.lower(`kind`),FfiConverterString.lower(`appDisplayName`),FfiConverterString.lower(`deviceDisplayName`),FfiConverterOptionalString.lower(`profileTag`),FfiConverterString.lower(`lang`), _status) } @@ -4203,8 +4274,8 @@ open class Client : FFIObject, ClientInterface { override fun `syncService`(): SyncServiceBuilder = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_sync_service(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_sync_service(it, _status) } @@ -4215,8 +4286,8 @@ open class Client : FFIObject, ClientInterface { @Throws(ClientException::class)override fun `unignoreUser`(`userId`: String) = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_unignore_user(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_unignore_user(it, FfiConverterString.lower(`userId`), _status) } @@ -4226,8 +4297,8 @@ open class Client : FFIObject, ClientInterface { @Throws(ClientException::class)override fun `uploadAvatar`(`mimeType`: String, `data`: ByteArray) = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_upload_avatar(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_upload_avatar(it, FfiConverterString.lower(`mimeType`),FfiConverterByteArray.lower(`data`), _status) } @@ -4240,14 +4311,14 @@ open class Client : FFIObject, ClientInterface { override suspend fun `uploadMedia`(`mimeType`: String, `data`: ByteArray, `progressWatcher`: ProgressWatcher?) : String { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_upload_media( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_upload_media( thisPtr, FfiConverterString.lower(`mimeType`),FfiConverterByteArray.lower(`data`),FfiConverterOptionalTypeProgressWatcher.lower(`progressWatcher`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterString.lift(it) }, // Error FFI converter @@ -4257,8 +4328,8 @@ open class Client : FFIObject, ClientInterface { @Throws(ClientException::class)override fun `userId`(): String = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_user_id(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_user_id(it, _status) } @@ -4349,36 +4420,34 @@ open class ClientBuilder : FFIObject, ClientBuilderInterface { constructor(noPointer: NoPointer): super(noPointer) constructor() : this( - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_constructor_clientbuilder_new(_status) + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_constructor_clientbuilder_new(_status) }) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_clientbuilder(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_clientbuilder(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_clientbuilder(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_clientbuilder(pointer!!, status) } } override fun `basePath`(`path`: String): ClientBuilder = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_base_path(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_base_path(it, FfiConverterString.lower(`path`), _status) } @@ -4389,8 +4458,8 @@ open class ClientBuilder : FFIObject, ClientBuilderInterface { @Throws(ClientException::class)override fun `build`(): Client = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_build(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_build(it, _status) } @@ -4400,8 +4469,8 @@ open class ClientBuilder : FFIObject, ClientBuilderInterface { override fun `disableAutomaticTokenRefresh`(): ClientBuilder = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_disable_automatic_token_refresh(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_disable_automatic_token_refresh(it, _status) } @@ -4411,8 +4480,8 @@ open class ClientBuilder : FFIObject, ClientBuilderInterface { override fun `disableSslVerification`(): ClientBuilder = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_disable_ssl_verification(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_disable_ssl_verification(it, _status) } @@ -4422,8 +4491,8 @@ open class ClientBuilder : FFIObject, ClientBuilderInterface { override fun `enableCrossProcessRefreshLock`(`processId`: String, `sessionDelegate`: ClientSessionDelegate): ClientBuilder = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_enable_cross_process_refresh_lock(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_enable_cross_process_refresh_lock(it, FfiConverterString.lower(`processId`),FfiConverterTypeClientSessionDelegate.lower(`sessionDelegate`), _status) } @@ -4433,8 +4502,8 @@ open class ClientBuilder : FFIObject, ClientBuilderInterface { override fun `homeserverUrl`(`url`: String): ClientBuilder = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_homeserver_url(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_homeserver_url(it, FfiConverterString.lower(`url`), _status) } @@ -4444,8 +4513,8 @@ open class ClientBuilder : FFIObject, ClientBuilderInterface { override fun `passphrase`(`passphrase`: String?): ClientBuilder = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_passphrase(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_passphrase(it, FfiConverterOptionalString.lower(`passphrase`), _status) } @@ -4455,8 +4524,8 @@ open class ClientBuilder : FFIObject, ClientBuilderInterface { override fun `proxy`(`url`: String): ClientBuilder = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_proxy(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_proxy(it, FfiConverterString.lower(`url`), _status) } @@ -4466,8 +4535,8 @@ open class ClientBuilder : FFIObject, ClientBuilderInterface { override fun `serverName`(`serverName`: String): ClientBuilder = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_server_name(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_server_name(it, FfiConverterString.lower(`serverName`), _status) } @@ -4477,8 +4546,8 @@ open class ClientBuilder : FFIObject, ClientBuilderInterface { override fun `serverVersions`(`versions`: List): ClientBuilder = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_server_versions(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_server_versions(it, FfiConverterSequenceString.lower(`versions`), _status) } @@ -4488,8 +4557,8 @@ open class ClientBuilder : FFIObject, ClientBuilderInterface { override fun `setSessionDelegate`(`sessionDelegate`: ClientSessionDelegate): ClientBuilder = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_set_session_delegate(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_set_session_delegate(it, FfiConverterTypeClientSessionDelegate.lower(`sessionDelegate`), _status) } @@ -4499,8 +4568,8 @@ open class ClientBuilder : FFIObject, ClientBuilderInterface { override fun `slidingSyncProxy`(`slidingSyncProxy`: String?): ClientBuilder = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_sliding_sync_proxy(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_sliding_sync_proxy(it, FfiConverterOptionalString.lower(`slidingSyncProxy`), _status) } @@ -4510,8 +4579,8 @@ open class ClientBuilder : FFIObject, ClientBuilderInterface { override fun `userAgent`(`userAgent`: String): ClientBuilder = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_user_agent(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_user_agent(it, FfiConverterString.lower(`userAgent`), _status) } @@ -4521,8 +4590,8 @@ open class ClientBuilder : FFIObject, ClientBuilderInterface { override fun `username`(`username`: String): ClientBuilder = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_username(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_username(it, FfiConverterString.lower(`username`), _status) } @@ -4621,25 +4690,23 @@ open class Encryption : FFIObject, EncryptionInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_encryption(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_encryption(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_encryption(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_encryption(pointer!!, status) } } @@ -4660,14 +4727,14 @@ open class Encryption : FFIObject, EncryptionInterface { override suspend fun `backupExistsOnServer`() : Boolean { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_backup_exists_on_server( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_backup_exists_on_server( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, // lift function { FfiConverterBoolean.lift(it) }, // Error FFI converter @@ -4676,8 +4743,8 @@ open class Encryption : FFIObject, EncryptionInterface { } override fun `backupState`(): BackupState = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_backup_state(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_backup_state(it, _status) } @@ -4687,8 +4754,8 @@ open class Encryption : FFIObject, EncryptionInterface { override fun `backupStateListener`(`listener`: BackupStateListener): TaskHandle = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_backup_state_listener(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_backup_state_listener(it, FfiConverterTypeBackupStateListener.lower(`listener`), _status) } @@ -4702,14 +4769,14 @@ open class Encryption : FFIObject, EncryptionInterface { override suspend fun `disableRecovery`() { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_disable_recovery( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_disable_recovery( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, @@ -4723,14 +4790,14 @@ open class Encryption : FFIObject, EncryptionInterface { override suspend fun `enableBackups`() { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_enable_backups( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_enable_backups( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, @@ -4744,14 +4811,14 @@ open class Encryption : FFIObject, EncryptionInterface { override suspend fun `enableRecovery`(`waitForBackupsToUpload`: Boolean, `progressListener`: EnableRecoveryProgressListener) : String { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_enable_recovery( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_enable_recovery( thisPtr, FfiConverterBoolean.lower(`waitForBackupsToUpload`),FfiConverterTypeEnableRecoveryProgressListener.lower(`progressListener`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterString.lift(it) }, // Error FFI converter @@ -4764,14 +4831,14 @@ open class Encryption : FFIObject, EncryptionInterface { override suspend fun `isLastDevice`() : Boolean { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_is_last_device( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_is_last_device( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, // lift function { FfiConverterBoolean.lift(it) }, // Error FFI converter @@ -4784,14 +4851,14 @@ open class Encryption : FFIObject, EncryptionInterface { override suspend fun `recover`(`recoveryKey`: String) { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_recover( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_recover( thisPtr, FfiConverterString.lower(`recoveryKey`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, @@ -4805,14 +4872,14 @@ open class Encryption : FFIObject, EncryptionInterface { override suspend fun `recoverAndReset`(`oldRecoveryKey`: String) : String { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_recover_and_reset( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_recover_and_reset( thisPtr, FfiConverterString.lower(`oldRecoveryKey`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterString.lift(it) }, // Error FFI converter @@ -4821,8 +4888,8 @@ open class Encryption : FFIObject, EncryptionInterface { } override fun `recoveryState`(): RecoveryState = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_recovery_state(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_recovery_state(it, _status) } @@ -4832,8 +4899,8 @@ open class Encryption : FFIObject, EncryptionInterface { override fun `recoveryStateListener`(`listener`: RecoveryStateListener): TaskHandle = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_recovery_state_listener(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_recovery_state_listener(it, FfiConverterTypeRecoveryStateListener.lower(`listener`), _status) } @@ -4847,14 +4914,14 @@ open class Encryption : FFIObject, EncryptionInterface { override suspend fun `resetRecoveryKey`() : String { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_reset_recovery_key( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_reset_recovery_key( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterString.lift(it) }, // Error FFI converter @@ -4867,14 +4934,14 @@ open class Encryption : FFIObject, EncryptionInterface { override suspend fun `waitForBackupUploadSteadyState`(`progressListener`: BackupSteadyStateListener?) { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_wait_for_backup_upload_steady_state( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_wait_for_backup_upload_steady_state( thisPtr, FfiConverterOptionalTypeBackupSteadyStateListener.lower(`progressListener`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, @@ -4968,32 +5035,30 @@ open class EventTimelineItem : FFIObject, EventTimelineItemInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_eventtimelineitem(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_eventtimelineitem(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_eventtimelineitem(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_eventtimelineitem(pointer!!, status) } } override fun `canBeRepliedTo`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_can_be_replied_to(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_can_be_replied_to(it, _status) } @@ -5003,8 +5068,8 @@ open class EventTimelineItem : FFIObject, EventTimelineItemInterface { override fun `content`(): TimelineItemContent = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_content(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_content(it, _status) } @@ -5014,8 +5079,8 @@ open class EventTimelineItem : FFIObject, EventTimelineItemInterface { override fun `debugInfo`(): EventTimelineItemDebugInfo = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_debug_info(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_debug_info(it, _status) } @@ -5025,8 +5090,8 @@ open class EventTimelineItem : FFIObject, EventTimelineItemInterface { override fun `eventId`(): String? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_event_id(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_event_id(it, _status) } @@ -5036,8 +5101,8 @@ open class EventTimelineItem : FFIObject, EventTimelineItemInterface { override fun `isEditable`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_is_editable(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_is_editable(it, _status) } @@ -5047,8 +5112,8 @@ open class EventTimelineItem : FFIObject, EventTimelineItemInterface { override fun `isLocal`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_is_local(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_is_local(it, _status) } @@ -5058,8 +5123,8 @@ open class EventTimelineItem : FFIObject, EventTimelineItemInterface { override fun `isOwn`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_is_own(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_is_own(it, _status) } @@ -5069,8 +5134,8 @@ open class EventTimelineItem : FFIObject, EventTimelineItemInterface { override fun `isRemote`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_is_remote(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_is_remote(it, _status) } @@ -5080,8 +5145,8 @@ open class EventTimelineItem : FFIObject, EventTimelineItemInterface { override fun `localSendState`(): EventSendState? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_local_send_state(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_local_send_state(it, _status) } @@ -5091,8 +5156,8 @@ open class EventTimelineItem : FFIObject, EventTimelineItemInterface { override fun `origin`(): EventItemOrigin? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_origin(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_origin(it, _status) } @@ -5102,8 +5167,8 @@ open class EventTimelineItem : FFIObject, EventTimelineItemInterface { override fun `reactions`(): List = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_reactions(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_reactions(it, _status) } @@ -5113,8 +5178,8 @@ open class EventTimelineItem : FFIObject, EventTimelineItemInterface { override fun `readReceipts`(): Map = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_read_receipts(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_read_receipts(it, _status) } @@ -5124,8 +5189,8 @@ open class EventTimelineItem : FFIObject, EventTimelineItemInterface { override fun `sender`(): String = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_sender(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_sender(it, _status) } @@ -5135,8 +5200,8 @@ open class EventTimelineItem : FFIObject, EventTimelineItemInterface { override fun `senderProfile`(): ProfileDetails = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_sender_profile(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_sender_profile(it, _status) } @@ -5146,8 +5211,8 @@ open class EventTimelineItem : FFIObject, EventTimelineItemInterface { override fun `timestamp`(): ULong = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_timestamp(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_timestamp(it, _status) } @@ -5157,8 +5222,8 @@ open class EventTimelineItem : FFIObject, EventTimelineItemInterface { override fun `transactionId`(): String? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_transaction_id(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_eventtimelineitem_transaction_id(it, _status) } @@ -5235,25 +5300,23 @@ open class HomeserverLoginDetails : FFIObject, HomeserverLoginDetailsInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_homeserverlogindetails(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_homeserverlogindetails(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_homeserverlogindetails(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_homeserverlogindetails(pointer!!, status) } } @@ -5262,8 +5325,8 @@ open class HomeserverLoginDetails : FFIObject, HomeserverLoginDetailsInterface { * Whether the current homeserver supports login using OIDC. */override fun `supportsOidcLogin`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_homeserverlogindetails_supports_oidc_login(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_homeserverlogindetails_supports_oidc_login(it, _status) } @@ -5276,8 +5339,8 @@ open class HomeserverLoginDetails : FFIObject, HomeserverLoginDetailsInterface { * Whether the current homeserver supports the password login flow. */override fun `supportsPasswordLogin`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_homeserverlogindetails_supports_password_login(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_homeserverlogindetails_supports_password_login(it, _status) } @@ -5290,8 +5353,8 @@ open class HomeserverLoginDetails : FFIObject, HomeserverLoginDetailsInterface { * The URL of the currently configured homeserver. */override fun `url`(): String = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_homeserverlogindetails_url(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_homeserverlogindetails_url(it, _status) } @@ -5368,25 +5431,23 @@ open class MediaFileHandle : FFIObject, MediaFileHandleInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_mediafilehandle(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_mediafilehandle(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_mediafilehandle(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_mediafilehandle(pointer!!, status) } } @@ -5396,8 +5457,8 @@ open class MediaFileHandle : FFIObject, MediaFileHandleInterface { */ @Throws(ClientException::class)override fun `path`(): String = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_mediafilehandle_path(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_mediafilehandle_path(it, _status) } @@ -5408,8 +5469,8 @@ open class MediaFileHandle : FFIObject, MediaFileHandleInterface { @Throws(ClientException::class)override fun `persist`(`path`: String): Boolean = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_mediafilehandle_persist(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_mediafilehandle_persist(it, FfiConverterString.lower(`path`), _status) } @@ -5475,32 +5536,30 @@ open class MediaSource : FFIObject, MediaSourceInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_mediasource(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_mediasource(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_mediasource(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_mediasource(pointer!!, status) } } override fun `toJson`(): String = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_mediasource_to_json(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_mediasource_to_json(it, _status) } @@ -5510,8 +5569,8 @@ open class MediaSource : FFIObject, MediaSourceInterface { override fun `url`(): String = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_mediasource_url(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_mediasource_url(it, _status) } @@ -5525,8 +5584,8 @@ open class MediaSource : FFIObject, MediaSourceInterface { fun `fromJson`(`json`: String): MediaSource = MediaSource( - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_constructor_mediasource_from_json(FfiConverterString.lower(`json`),_status) + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_constructor_mediasource_from_json(FfiConverterString.lower(`json`),_status) }) } @@ -5590,32 +5649,30 @@ open class Message : FFIObject, MessageInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_message(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_message(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_message(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_message(pointer!!, status) } } override fun `body`(): String = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_message_body(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_message_body(it, _status) } @@ -5625,8 +5682,8 @@ open class Message : FFIObject, MessageInterface { override fun `inReplyTo`(): InReplyToDetails? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_message_in_reply_to(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_message_in_reply_to(it, _status) } @@ -5636,8 +5693,8 @@ open class Message : FFIObject, MessageInterface { override fun `isEdited`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_message_is_edited(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_message_is_edited(it, _status) } @@ -5647,8 +5704,8 @@ open class Message : FFIObject, MessageInterface { override fun `isThreaded`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_message_is_threaded(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_message_is_threaded(it, _status) } @@ -5658,8 +5715,8 @@ open class Message : FFIObject, MessageInterface { override fun `msgtype`(): MessageType = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_message_msgtype(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_message_msgtype(it, _status) } @@ -5727,25 +5784,23 @@ open class NotificationClient : FFIObject, NotificationClientInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_notificationclient(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_notificationclient(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_notificationclient(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_notificationclient(pointer!!, status) } } @@ -5756,8 +5811,8 @@ open class NotificationClient : FFIObject, NotificationClientInterface { */ @Throws(ClientException::class)override fun `getNotification`(`roomId`: String, `eventId`: String): NotificationItem? = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationclient_get_notification(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationclient_get_notification(it, FfiConverterString.lower(`roomId`),FfiConverterString.lower(`eventId`), _status) } @@ -5827,25 +5882,23 @@ open class NotificationClientBuilder : FFIObject, NotificationClientBuilderInter */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_notificationclientbuilder(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_notificationclientbuilder(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_notificationclientbuilder(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_notificationclientbuilder(pointer!!, status) } } @@ -5855,8 +5908,8 @@ open class NotificationClientBuilder : FFIObject, NotificationClientBuilderInter * the event. */override fun `filterByPushRules`(): NotificationClientBuilder = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationclientbuilder_filter_by_push_rules(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationclientbuilder_filter_by_push_rules(it, _status) } @@ -5866,8 +5919,8 @@ open class NotificationClientBuilder : FFIObject, NotificationClientBuilderInter override fun `finish`(): NotificationClient = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationclientbuilder_finish(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationclientbuilder_finish(it, _status) } @@ -6053,25 +6106,23 @@ open class NotificationSettings : FFIObject, NotificationSettingsInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_notificationsettings(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_notificationsettings(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_notificationsettings(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_notificationsettings(pointer!!, status) } } @@ -6085,18 +6136,18 @@ open class NotificationSettings : FFIObject, NotificationSettingsInterface { override suspend fun `canPushEncryptedEventToDevice`() : Boolean { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_can_push_encrypted_event_to_device( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_can_push_encrypted_event_to_device( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, // lift function { FfiConverterBoolean.lift(it) }, // Error FFI converter - NullCallStatusErrorHandler, + UniffiNullRustCallStatusErrorHandler, ) } @@ -6107,18 +6158,18 @@ open class NotificationSettings : FFIObject, NotificationSettingsInterface { override suspend fun `containsKeywordsRules`() : Boolean { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_contains_keywords_rules( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_contains_keywords_rules( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, // lift function { FfiConverterBoolean.lift(it) }, // Error FFI converter - NullCallStatusErrorHandler, + UniffiNullRustCallStatusErrorHandler, ) } @@ -6138,18 +6189,18 @@ open class NotificationSettings : FFIObject, NotificationSettingsInterface { override suspend fun `getDefaultRoomNotificationMode`(`isEncrypted`: Boolean, `isOneToOne`: Boolean) : RoomNotificationMode { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_get_default_room_notification_mode( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_get_default_room_notification_mode( thisPtr, FfiConverterBoolean.lower(`isEncrypted`),FfiConverterBoolean.lower(`isOneToOne`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterTypeRoomNotificationMode.lift(it) }, // Error FFI converter - NullCallStatusErrorHandler, + UniffiNullRustCallStatusErrorHandler, ) } @@ -6168,14 +6219,14 @@ open class NotificationSettings : FFIObject, NotificationSettingsInterface { override suspend fun `getRoomNotificationSettings`(`roomId`: String, `isEncrypted`: Boolean, `isOneToOne`: Boolean) : RoomNotificationSettings { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_get_room_notification_settings( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_get_room_notification_settings( thisPtr, FfiConverterString.lower(`roomId`),FfiConverterBoolean.lower(`isEncrypted`),FfiConverterBoolean.lower(`isOneToOne`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterTypeRoomNotificationSettings.lift(it) }, // Error FFI converter @@ -6190,18 +6241,18 @@ open class NotificationSettings : FFIObject, NotificationSettingsInterface { override suspend fun `getRoomsWithUserDefinedRules`(`enabled`: Boolean?) : List { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_get_rooms_with_user_defined_rules( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_get_rooms_with_user_defined_rules( thisPtr, FfiConverterOptionalBoolean.lower(`enabled`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterSequenceString.lift(it) }, // Error FFI converter - NullCallStatusErrorHandler, + UniffiNullRustCallStatusErrorHandler, ) } @@ -6213,14 +6264,14 @@ open class NotificationSettings : FFIObject, NotificationSettingsInterface { override suspend fun `getUserDefinedRoomNotificationMode`(`roomId`: String) : RoomNotificationMode? { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_get_user_defined_room_notification_mode( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_get_user_defined_room_notification_mode( thisPtr, FfiConverterString.lower(`roomId`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterOptionalTypeRoomNotificationMode.lift(it) }, // Error FFI converter @@ -6236,14 +6287,14 @@ open class NotificationSettings : FFIObject, NotificationSettingsInterface { override suspend fun `isCallEnabled`() : Boolean { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_is_call_enabled( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_is_call_enabled( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, // lift function { FfiConverterBoolean.lift(it) }, // Error FFI converter @@ -6259,14 +6310,14 @@ open class NotificationSettings : FFIObject, NotificationSettingsInterface { override suspend fun `isInviteForMeEnabled`() : Boolean { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_is_invite_for_me_enabled( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_is_invite_for_me_enabled( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, // lift function { FfiConverterBoolean.lift(it) }, // Error FFI converter @@ -6282,14 +6333,14 @@ open class NotificationSettings : FFIObject, NotificationSettingsInterface { override suspend fun `isRoomMentionEnabled`() : Boolean { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_is_room_mention_enabled( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_is_room_mention_enabled( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, // lift function { FfiConverterBoolean.lift(it) }, // Error FFI converter @@ -6305,14 +6356,14 @@ open class NotificationSettings : FFIObject, NotificationSettingsInterface { override suspend fun `isUserMentionEnabled`() : Boolean { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_is_user_mention_enabled( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_is_user_mention_enabled( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, // lift function { FfiConverterBoolean.lift(it) }, // Error FFI converter @@ -6328,14 +6379,14 @@ open class NotificationSettings : FFIObject, NotificationSettingsInterface { override suspend fun `restoreDefaultRoomNotificationMode`(`roomId`: String) { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_restore_default_room_notification_mode( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_restore_default_room_notification_mode( thisPtr, FfiConverterString.lower(`roomId`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, @@ -6352,14 +6403,14 @@ open class NotificationSettings : FFIObject, NotificationSettingsInterface { override suspend fun `setCallEnabled`(`enabled`: Boolean) { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_set_call_enabled( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_set_call_enabled( thisPtr, FfiConverterBoolean.lower(`enabled`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, @@ -6383,14 +6434,14 @@ open class NotificationSettings : FFIObject, NotificationSettingsInterface { override suspend fun `setDefaultRoomNotificationMode`(`isEncrypted`: Boolean, `isOneToOne`: Boolean, `mode`: RoomNotificationMode) { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_set_default_room_notification_mode( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_set_default_room_notification_mode( thisPtr, FfiConverterBoolean.lower(`isEncrypted`),FfiConverterBoolean.lower(`isOneToOne`),FfiConverterTypeRoomNotificationMode.lower(`mode`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, @@ -6400,8 +6451,8 @@ open class NotificationSettings : FFIObject, NotificationSettingsInterface { } override fun `setDelegate`(`delegate`: NotificationSettingsDelegate?) = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_set_delegate(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_set_delegate(it, FfiConverterOptionalTypeNotificationSettingsDelegate.lower(`delegate`), _status) } @@ -6417,14 +6468,14 @@ open class NotificationSettings : FFIObject, NotificationSettingsInterface { override suspend fun `setInviteForMeEnabled`(`enabled`: Boolean) { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_set_invite_for_me_enabled( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_set_invite_for_me_enabled( thisPtr, FfiConverterBoolean.lower(`enabled`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, @@ -6441,14 +6492,14 @@ open class NotificationSettings : FFIObject, NotificationSettingsInterface { override suspend fun `setRoomMentionEnabled`(`enabled`: Boolean) { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_set_room_mention_enabled( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_set_room_mention_enabled( thisPtr, FfiConverterBoolean.lower(`enabled`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, @@ -6465,14 +6516,14 @@ open class NotificationSettings : FFIObject, NotificationSettingsInterface { override suspend fun `setRoomNotificationMode`(`roomId`: String, `mode`: RoomNotificationMode) { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_set_room_notification_mode( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_set_room_notification_mode( thisPtr, FfiConverterString.lower(`roomId`),FfiConverterTypeRoomNotificationMode.lower(`mode`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, @@ -6489,14 +6540,14 @@ open class NotificationSettings : FFIObject, NotificationSettingsInterface { override suspend fun `setUserMentionEnabled`(`enabled`: Boolean) { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_set_user_mention_enabled( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_set_user_mention_enabled( thisPtr, FfiConverterBoolean.lower(`enabled`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, @@ -6520,14 +6571,14 @@ open class NotificationSettings : FFIObject, NotificationSettingsInterface { override suspend fun `unmuteRoom`(`roomId`: String, `isEncrypted`: Boolean, `isOneToOne`: Boolean) { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_unmute_room( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_unmute_room( thisPtr, FfiConverterString.lower(`roomId`),FfiConverterBoolean.lower(`isEncrypted`),FfiConverterBoolean.lower(`isOneToOne`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, @@ -6600,25 +6651,23 @@ open class OidcAuthenticationData : FFIObject, OidcAuthenticationDataInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_oidcauthenticationdata(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_oidcauthenticationdata(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_oidcauthenticationdata(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_oidcauthenticationdata(pointer!!, status) } } @@ -6627,8 +6676,8 @@ open class OidcAuthenticationData : FFIObject, OidcAuthenticationDataInterface { * The login URL to use for authentication. */override fun `loginUrl`(): String = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_oidcauthenticationdata_login_url(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_oidcauthenticationdata_login_url(it, _status) } @@ -6869,32 +6918,30 @@ open class Room : FFIObject, RoomInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_room(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_room(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_room(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_room(pointer!!, status) } } override fun `activeMembersCount`(): ULong = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_active_members_count(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_active_members_count(it, _status) } @@ -6914,8 +6961,8 @@ open class Room : FFIObject, RoomInterface { * The vector is ordered by oldest membership user to newest. */override fun `activeRoomCallParticipants`(): List = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_active_room_call_participants(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_active_room_call_participants(it, _status) } @@ -6925,8 +6972,8 @@ open class Room : FFIObject, RoomInterface { override fun `alternativeAliases`(): List = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_alternative_aliases(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_alternative_aliases(it, _status) } @@ -6936,8 +6983,8 @@ open class Room : FFIObject, RoomInterface { override fun `avatarUrl`(): String? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_avatar_url(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_avatar_url(it, _status) } @@ -6951,14 +6998,14 @@ open class Room : FFIObject, RoomInterface { override suspend fun `banUser`(`userId`: String, `reason`: String?) { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_ban_user( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_ban_user( thisPtr, FfiConverterString.lower(`userId`),FfiConverterOptionalString.lower(`reason`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, @@ -6972,14 +7019,14 @@ open class Room : FFIObject, RoomInterface { override suspend fun `canUserBan`(`userId`: String) : Boolean { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_can_user_ban( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_can_user_ban( thisPtr, FfiConverterString.lower(`userId`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, // lift function { FfiConverterBoolean.lift(it) }, // Error FFI converter @@ -6992,14 +7039,14 @@ open class Room : FFIObject, RoomInterface { override suspend fun `canUserInvite`(`userId`: String) : Boolean { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_can_user_invite( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_can_user_invite( thisPtr, FfiConverterString.lower(`userId`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, // lift function { FfiConverterBoolean.lift(it) }, // Error FFI converter @@ -7012,14 +7059,14 @@ open class Room : FFIObject, RoomInterface { override suspend fun `canUserKick`(`userId`: String) : Boolean { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_can_user_kick( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_can_user_kick( thisPtr, FfiConverterString.lower(`userId`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, // lift function { FfiConverterBoolean.lift(it) }, // Error FFI converter @@ -7032,14 +7079,14 @@ open class Room : FFIObject, RoomInterface { override suspend fun `canUserRedactOther`(`userId`: String) : Boolean { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_can_user_redact_other( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_can_user_redact_other( thisPtr, FfiConverterString.lower(`userId`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, // lift function { FfiConverterBoolean.lift(it) }, // Error FFI converter @@ -7052,14 +7099,14 @@ open class Room : FFIObject, RoomInterface { override suspend fun `canUserRedactOwn`(`userId`: String) : Boolean { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_can_user_redact_own( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_can_user_redact_own( thisPtr, FfiConverterString.lower(`userId`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, // lift function { FfiConverterBoolean.lift(it) }, // Error FFI converter @@ -7072,14 +7119,14 @@ open class Room : FFIObject, RoomInterface { override suspend fun `canUserSendMessage`(`userId`: String, `message`: MessageLikeEventType) : Boolean { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_can_user_send_message( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_can_user_send_message( thisPtr, FfiConverterString.lower(`userId`),FfiConverterTypeMessageLikeEventType.lower(`message`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, // lift function { FfiConverterBoolean.lift(it) }, // Error FFI converter @@ -7092,14 +7139,14 @@ open class Room : FFIObject, RoomInterface { override suspend fun `canUserSendState`(`userId`: String, `stateEvent`: StateEventType) : Boolean { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_can_user_send_state( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_can_user_send_state( thisPtr, FfiConverterString.lower(`userId`),FfiConverterTypeStateEventType.lower(`stateEvent`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, // lift function { FfiConverterBoolean.lift(it) }, // Error FFI converter @@ -7112,14 +7159,14 @@ open class Room : FFIObject, RoomInterface { override suspend fun `canUserTriggerRoomNotification`(`userId`: String) : Boolean { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_can_user_trigger_room_notification( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_can_user_trigger_room_notification( thisPtr, FfiConverterString.lower(`userId`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, // lift function { FfiConverterBoolean.lift(it) }, // Error FFI converter @@ -7128,8 +7175,8 @@ open class Room : FFIObject, RoomInterface { } override fun `canonicalAlias`(): String? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_canonical_alias(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_canonical_alias(it, _status) } @@ -7140,8 +7187,8 @@ open class Room : FFIObject, RoomInterface { @Throws(ClientException::class)override fun `displayName`(): String = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_display_name(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_display_name(it, _status) } @@ -7155,8 +7202,8 @@ open class Room : FFIObject, RoomInterface { * "m.room" in this room. */override fun `hasActiveRoomCall`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_has_active_room_call(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_has_active_room_call(it, _status) } @@ -7166,8 +7213,8 @@ open class Room : FFIObject, RoomInterface { override fun `id`(): String = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_id(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_id(it, _status) } @@ -7185,8 +7232,8 @@ open class Room : FFIObject, RoomInterface { */ @Throws(ClientException::class)override fun `ignoreUser`(`userId`: String) = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_ignore_user(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_ignore_user(it, FfiConverterString.lower(`userId`), _status) } @@ -7196,8 +7243,8 @@ open class Room : FFIObject, RoomInterface { @Throws(ClientException::class)override fun `inviteUserById`(`userId`: String) = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_invite_user_by_id(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_invite_user_by_id(it, FfiConverterString.lower(`userId`), _status) } @@ -7206,8 +7253,8 @@ open class Room : FFIObject, RoomInterface { override fun `invitedMembersCount`(): ULong = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_invited_members_count(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_invited_members_count(it, _status) } @@ -7217,8 +7264,8 @@ open class Room : FFIObject, RoomInterface { override fun `inviter`(): RoomMember? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_inviter(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_inviter(it, _status) } @@ -7228,8 +7275,8 @@ open class Room : FFIObject, RoomInterface { override fun `isDirect`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_is_direct(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_is_direct(it, _status) } @@ -7240,8 +7287,8 @@ open class Room : FFIObject, RoomInterface { @Throws(ClientException::class)override fun `isEncrypted`(): Boolean = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_is_encrypted(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_is_encrypted(it, _status) } @@ -7251,8 +7298,8 @@ open class Room : FFIObject, RoomInterface { override fun `isPublic`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_is_public(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_is_public(it, _status) } @@ -7262,8 +7309,8 @@ open class Room : FFIObject, RoomInterface { override fun `isSpace`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_is_space(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_is_space(it, _status) } @@ -7273,8 +7320,8 @@ open class Room : FFIObject, RoomInterface { override fun `isTombstoned`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_is_tombstoned(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_is_tombstoned(it, _status) } @@ -7290,8 +7337,8 @@ open class Room : FFIObject, RoomInterface { */ @Throws(ClientException::class)override fun `join`() = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_join(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_join(it, _status) } @@ -7300,8 +7347,8 @@ open class Room : FFIObject, RoomInterface { override fun `joinedMembersCount`(): ULong = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_joined_members_count(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_joined_members_count(it, _status) } @@ -7315,14 +7362,14 @@ open class Room : FFIObject, RoomInterface { override suspend fun `kickUser`(`userId`: String, `reason`: String?) { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_kick_user( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_kick_user( thisPtr, FfiConverterString.lower(`userId`),FfiConverterOptionalString.lower(`reason`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, @@ -7338,8 +7385,8 @@ open class Room : FFIObject, RoomInterface { */ @Throws(ClientException::class)override fun `leave`() = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_leave(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_leave(it, _status) } @@ -7352,14 +7399,14 @@ open class Room : FFIObject, RoomInterface { override suspend fun `member`(`userId`: String) : RoomMember { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_member( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_member( thisPtr, FfiConverterString.lower(`userId`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, // lift function { FfiConverterTypeRoomMember.lift(it) }, // Error FFI converter @@ -7369,8 +7416,8 @@ open class Room : FFIObject, RoomInterface { @Throws(ClientException::class)override fun `memberAvatarUrl`(`userId`: String): String? = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_member_avatar_url(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_member_avatar_url(it, FfiConverterString.lower(`userId`), _status) } @@ -7381,8 +7428,8 @@ open class Room : FFIObject, RoomInterface { @Throws(ClientException::class)override fun `memberDisplayName`(`userId`: String): String? = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_member_display_name(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_member_display_name(it, FfiConverterString.lower(`userId`), _status) } @@ -7396,14 +7443,14 @@ open class Room : FFIObject, RoomInterface { override suspend fun `members`() : RoomMembersIterator { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_members( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_members( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, // lift function { FfiConverterTypeRoomMembersIterator.lift(it) }, // Error FFI converter @@ -7416,14 +7463,14 @@ open class Room : FFIObject, RoomInterface { override suspend fun `membersNoSync`() : RoomMembersIterator { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_members_no_sync( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_members_no_sync( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, // lift function { FfiConverterTypeRoomMembersIterator.lift(it) }, // Error FFI converter @@ -7432,8 +7479,8 @@ open class Room : FFIObject, RoomInterface { } override fun `membership`(): Membership = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_membership(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_membership(it, _status) } @@ -7443,8 +7490,8 @@ open class Room : FFIObject, RoomInterface { override fun `name`(): String? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_name(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_name(it, _status) } @@ -7454,8 +7501,8 @@ open class Room : FFIObject, RoomInterface { override fun `ownUserId`(): String = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_own_user_id(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_own_user_id(it, _status) } @@ -7468,18 +7515,18 @@ open class Room : FFIObject, RoomInterface { override suspend fun `pollHistory`() : Timeline { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_poll_history( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_poll_history( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, // lift function { FfiConverterTypeTimeline.lift(it) }, // Error FFI converter - NullCallStatusErrorHandler, + UniffiNullRustCallStatusErrorHandler, ) } @@ -7495,8 +7542,8 @@ open class Room : FFIObject, RoomInterface { */ @Throws(ClientException::class)override fun `redact`(`eventId`: String, `reason`: String?) = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_redact(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_redact(it, FfiConverterString.lower(`eventId`),FfiConverterOptionalString.lower(`reason`), _status) } @@ -7509,8 +7556,8 @@ open class Room : FFIObject, RoomInterface { */ @Throws(ClientException::class)override fun `removeAvatar`() = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_remove_avatar(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_remove_avatar(it, _status) } @@ -7532,8 +7579,8 @@ open class Room : FFIObject, RoomInterface { */ @Throws(ClientException::class)override fun `reportContent`(`eventId`: String, `score`: Int?, `reason`: String?) = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_report_content(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_report_content(it, FfiConverterString.lower(`eventId`),FfiConverterOptionalInt.lower(`score`),FfiConverterOptionalString.lower(`reason`), _status) } @@ -7546,14 +7593,14 @@ open class Room : FFIObject, RoomInterface { override suspend fun `roomInfo`() : RoomInfo { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_room_info( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_room_info( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterTypeRoomInfo.lift(it) }, // Error FFI converter @@ -7566,8 +7613,8 @@ open class Room : FFIObject, RoomInterface { */ @Throws(ClientException::class)override fun `setName`(`name`: String) = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_set_name(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_set_name(it, FfiConverterString.lower(`name`), _status) } @@ -7580,8 +7627,8 @@ open class Room : FFIObject, RoomInterface { */ @Throws(ClientException::class)override fun `setTopic`(`topic`: String) = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_set_topic(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_set_topic(it, FfiConverterString.lower(`topic`), _status) } @@ -7590,8 +7637,8 @@ open class Room : FFIObject, RoomInterface { override fun `subscribeToRoomInfoUpdates`(`listener`: RoomInfoListener): TaskHandle = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_subscribe_to_room_info_updates(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_subscribe_to_room_info_updates(it, FfiConverterTypeRoomInfoListener.lower(`listener`), _status) } @@ -7604,24 +7651,24 @@ open class Room : FFIObject, RoomInterface { override suspend fun `timeline`() : Timeline { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_timeline( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_timeline( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, // lift function { FfiConverterTypeTimeline.lift(it) }, // Error FFI converter - NullCallStatusErrorHandler, + UniffiNullRustCallStatusErrorHandler, ) } override fun `topic`(): String? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_topic(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_topic(it, _status) } @@ -7635,14 +7682,14 @@ open class Room : FFIObject, RoomInterface { override suspend fun `typingNotice`(`isTyping`: Boolean) { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_typing_notice( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_typing_notice( thisPtr, FfiConverterBoolean.lower(`isTyping`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, @@ -7656,14 +7703,14 @@ open class Room : FFIObject, RoomInterface { override suspend fun `unbanUser`(`userId`: String, `reason`: String?) { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_unban_user( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_unban_user( thisPtr, FfiConverterString.lower(`userId`),FfiConverterOptionalString.lower(`reason`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, @@ -7689,8 +7736,8 @@ open class Room : FFIObject, RoomInterface { */ @Throws(ClientException::class)override fun `uploadAvatar`(`mimeType`: String, `data`: ByteArray, `mediaInfo`: ImageInfo?) = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_upload_avatar(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_upload_avatar(it, FfiConverterString.lower(`mimeType`),FfiConverterByteArray.lower(`data`),FfiConverterOptionalTypeImageInfo.lower(`mediaInfo`), _status) } @@ -7759,32 +7806,30 @@ open class RoomList : FFIObject, RoomListInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_roomlist(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_roomlist(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_roomlist(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_roomlist(pointer!!, status) } } override fun `entries`(`listener`: RoomListEntriesListener): RoomListEntriesResult = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlist_entries(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlist_entries(it, FfiConverterTypeRoomListEntriesListener.lower(`listener`), _status) } @@ -7794,8 +7839,8 @@ open class RoomList : FFIObject, RoomListInterface { override fun `entriesWithDynamicAdapters`(`pageSize`: UInt, `listener`: RoomListEntriesListener): RoomListEntriesWithDynamicAdaptersResult = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlist_entries_with_dynamic_adapters(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlist_entries_with_dynamic_adapters(it, FfiConverterUInt.lower(`pageSize`),FfiConverterTypeRoomListEntriesListener.lower(`listener`), _status) } @@ -7806,8 +7851,8 @@ open class RoomList : FFIObject, RoomListInterface { @Throws(RoomListException::class)override fun `loadingState`(`listener`: RoomListLoadingStateListener): RoomListLoadingStateResult = callWithPointer { - rustCallWithError(RoomListException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlist_loading_state(it, + uniffiRustCallWithError(RoomListException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlist_loading_state(it, FfiConverterTypeRoomListLoadingStateListener.lower(`listener`), _status) } @@ -7818,8 +7863,8 @@ open class RoomList : FFIObject, RoomListInterface { @Throws(RoomListException::class)override fun `room`(`roomId`: String): RoomListItem = callWithPointer { - rustCallWithError(RoomListException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlist_room(it, + uniffiRustCallWithError(RoomListException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlist_room(it, FfiConverterString.lower(`roomId`), _status) } @@ -7887,32 +7932,30 @@ open class RoomListDynamicEntriesController : FFIObject, RoomListDynamicEntriesC */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_roomlistdynamicentriescontroller(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_roomlistdynamicentriescontroller(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_roomlistdynamicentriescontroller(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_roomlistdynamicentriescontroller(pointer!!, status) } } override fun `addOnePage`() = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistdynamicentriescontroller_add_one_page(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistdynamicentriescontroller_add_one_page(it, _status) } @@ -7921,8 +7964,8 @@ open class RoomListDynamicEntriesController : FFIObject, RoomListDynamicEntriesC override fun `resetToOnePage`() = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistdynamicentriescontroller_reset_to_one_page(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistdynamicentriescontroller_reset_to_one_page(it, _status) } @@ -7931,8 +7974,8 @@ open class RoomListDynamicEntriesController : FFIObject, RoomListDynamicEntriesC override fun `setFilter`(`kind`: RoomListEntriesDynamicFilterKind): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistdynamicentriescontroller_set_filter(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistdynamicentriescontroller_set_filter(it, FfiConverterTypeRoomListEntriesDynamicFilterKind.lower(`kind`), _status) } @@ -8024,32 +8067,30 @@ open class RoomListItem : FFIObject, RoomListItemInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_roomlistitem(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_roomlistitem(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_roomlistitem(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_roomlistitem(pointer!!, status) } } override fun `avatarUrl`(): String? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistitem_avatar_url(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistitem_avatar_url(it, _status) } @@ -8059,8 +8100,8 @@ open class RoomListItem : FFIObject, RoomListItemInterface { override fun `canonicalAlias`(): String? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistitem_canonical_alias(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistitem_canonical_alias(it, _status) } @@ -8079,24 +8120,24 @@ open class RoomListItem : FFIObject, RoomListItemInterface { override suspend fun `fullRoom`() : Room { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistitem_full_room( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistitem_full_room( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, // lift function { FfiConverterTypeRoom.lift(it) }, // Error FFI converter - NullCallStatusErrorHandler, + UniffiNullRustCallStatusErrorHandler, ) } override fun `hasUnreadNotifications`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistitem_has_unread_notifications(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistitem_has_unread_notifications(it, _status) } @@ -8106,8 +8147,8 @@ open class RoomListItem : FFIObject, RoomListItemInterface { override fun `id`(): String = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistitem_id(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistitem_id(it, _status) } @@ -8117,8 +8158,8 @@ open class RoomListItem : FFIObject, RoomListItemInterface { override fun `isDirect`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistitem_is_direct(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistitem_is_direct(it, _status) } @@ -8131,24 +8172,24 @@ open class RoomListItem : FFIObject, RoomListItemInterface { override suspend fun `latestEvent`() : EventTimelineItem? { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistitem_latest_event( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistitem_latest_event( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterOptionalTypeEventTimelineItem.lift(it) }, // Error FFI converter - NullCallStatusErrorHandler, + UniffiNullRustCallStatusErrorHandler, ) } override fun `name`(): String? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistitem_name(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistitem_name(it, _status) } @@ -8162,14 +8203,14 @@ open class RoomListItem : FFIObject, RoomListItemInterface { override suspend fun `roomInfo`() : RoomInfo { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistitem_room_info( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistitem_room_info( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterTypeRoomInfo.lift(it) }, // Error FFI converter @@ -8178,8 +8219,8 @@ open class RoomListItem : FFIObject, RoomListItemInterface { } override fun `subscribe`(`settings`: RoomSubscription?) = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistitem_subscribe(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistitem_subscribe(it, FfiConverterOptionalTypeRoomSubscription.lower(`settings`), _status) } @@ -8188,8 +8229,8 @@ open class RoomListItem : FFIObject, RoomListItemInterface { override fun `unreadNotifications`(): UnreadNotificationsCount = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistitem_unread_notifications(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistitem_unread_notifications(it, _status) } @@ -8199,8 +8240,8 @@ open class RoomListItem : FFIObject, RoomListItemInterface { override fun `unsubscribe`() = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistitem_unsubscribe(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistitem_unsubscribe(it, _status) } @@ -8273,25 +8314,23 @@ open class RoomListService : FFIObject, RoomListServiceInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_roomlistservice(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_roomlistservice(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_roomlistservice(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_roomlistservice(pointer!!, status) } } @@ -8301,14 +8340,14 @@ open class RoomListService : FFIObject, RoomListServiceInterface { override suspend fun `allRooms`() : RoomList { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistservice_all_rooms( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistservice_all_rooms( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, // lift function { FfiConverterTypeRoomList.lift(it) }, // Error FFI converter @@ -8321,14 +8360,14 @@ open class RoomListService : FFIObject, RoomListServiceInterface { override suspend fun `applyInput`(`input`: RoomListInput) { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistservice_apply_input( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistservice_apply_input( thisPtr, FfiConverterTypeRoomListInput.lower(`input`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, @@ -8342,14 +8381,14 @@ open class RoomListService : FFIObject, RoomListServiceInterface { override suspend fun `invites`() : RoomList { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistservice_invites( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistservice_invites( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, // lift function { FfiConverterTypeRoomList.lift(it) }, // Error FFI converter @@ -8359,8 +8398,8 @@ open class RoomListService : FFIObject, RoomListServiceInterface { @Throws(RoomListException::class)override fun `room`(`roomId`: String): RoomListItem = callWithPointer { - rustCallWithError(RoomListException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistservice_room(it, + uniffiRustCallWithError(RoomListException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistservice_room(it, FfiConverterString.lower(`roomId`), _status) } @@ -8370,8 +8409,8 @@ open class RoomListService : FFIObject, RoomListServiceInterface { override fun `state`(`listener`: RoomListServiceStateListener): TaskHandle = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistservice_state(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistservice_state(it, FfiConverterTypeRoomListServiceStateListener.lower(`listener`), _status) } @@ -8381,8 +8420,8 @@ open class RoomListService : FFIObject, RoomListServiceInterface { override fun `syncIndicator`(`delayBeforeShowingInMs`: UInt, `delayBeforeHidingInMs`: UInt, `listener`: RoomListServiceSyncIndicatorListener): TaskHandle = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistservice_sync_indicator(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlistservice_sync_indicator(it, FfiConverterUInt.lower(`delayBeforeShowingInMs`),FfiConverterUInt.lower(`delayBeforeHidingInMs`),FfiConverterTypeRoomListServiceSyncIndicatorListener.lower(`listener`), _status) } @@ -8490,32 +8529,30 @@ open class RoomMember : FFIObject, RoomMemberInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_roommember(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_roommember(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_roommember(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_roommember(pointer!!, status) } } override fun `avatarUrl`(): String? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_avatar_url(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_avatar_url(it, _status) } @@ -8525,8 +8562,8 @@ open class RoomMember : FFIObject, RoomMemberInterface { override fun `canBan`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_can_ban(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_can_ban(it, _status) } @@ -8536,8 +8573,8 @@ open class RoomMember : FFIObject, RoomMemberInterface { override fun `canInvite`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_can_invite(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_can_invite(it, _status) } @@ -8547,8 +8584,8 @@ open class RoomMember : FFIObject, RoomMemberInterface { override fun `canKick`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_can_kick(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_can_kick(it, _status) } @@ -8558,8 +8595,8 @@ open class RoomMember : FFIObject, RoomMemberInterface { override fun `canRedactOther`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_can_redact_other(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_can_redact_other(it, _status) } @@ -8569,8 +8606,8 @@ open class RoomMember : FFIObject, RoomMemberInterface { override fun `canRedactOwn`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_can_redact_own(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_can_redact_own(it, _status) } @@ -8580,8 +8617,8 @@ open class RoomMember : FFIObject, RoomMemberInterface { override fun `canSendMessage`(`event`: MessageLikeEventType): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_can_send_message(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_can_send_message(it, FfiConverterTypeMessageLikeEventType.lower(`event`), _status) } @@ -8591,8 +8628,8 @@ open class RoomMember : FFIObject, RoomMemberInterface { override fun `canSendState`(`stateEvent`: StateEventType): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_can_send_state(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_can_send_state(it, FfiConverterTypeStateEventType.lower(`stateEvent`), _status) } @@ -8602,8 +8639,8 @@ open class RoomMember : FFIObject, RoomMemberInterface { override fun `canTriggerRoomNotification`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_can_trigger_room_notification(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_can_trigger_room_notification(it, _status) } @@ -8613,8 +8650,8 @@ open class RoomMember : FFIObject, RoomMemberInterface { override fun `displayName`(): String? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_display_name(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_display_name(it, _status) } @@ -8629,8 +8666,8 @@ open class RoomMember : FFIObject, RoomMemberInterface { */ @Throws(ClientException::class)override fun `ignore`() = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_ignore(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_ignore(it, _status) } @@ -8639,8 +8676,8 @@ open class RoomMember : FFIObject, RoomMemberInterface { override fun `isAccountUser`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_is_account_user(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_is_account_user(it, _status) } @@ -8650,8 +8687,8 @@ open class RoomMember : FFIObject, RoomMemberInterface { override fun `isIgnored`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_is_ignored(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_is_ignored(it, _status) } @@ -8661,8 +8698,8 @@ open class RoomMember : FFIObject, RoomMemberInterface { override fun `isNameAmbiguous`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_is_name_ambiguous(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_is_name_ambiguous(it, _status) } @@ -8672,8 +8709,8 @@ open class RoomMember : FFIObject, RoomMemberInterface { override fun `membership`(): MembershipState = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_membership(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_membership(it, _status) } @@ -8683,8 +8720,8 @@ open class RoomMember : FFIObject, RoomMemberInterface { override fun `normalizedPowerLevel`(): Long = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_normalized_power_level(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_normalized_power_level(it, _status) } @@ -8694,8 +8731,8 @@ open class RoomMember : FFIObject, RoomMemberInterface { override fun `powerLevel`(): Long = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_power_level(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_power_level(it, _status) } @@ -8710,8 +8747,8 @@ open class RoomMember : FFIObject, RoomMemberInterface { */ @Throws(ClientException::class)override fun `unignore`() = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_unignore(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_unignore(it, _status) } @@ -8720,8 +8757,8 @@ open class RoomMember : FFIObject, RoomMemberInterface { override fun `userId`(): String = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_user_id(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommember_user_id(it, _status) } @@ -8787,32 +8824,30 @@ open class RoomMembersIterator : FFIObject, RoomMembersIteratorInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_roommembersiterator(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_roommembersiterator(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_roommembersiterator(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_roommembersiterator(pointer!!, status) } } override fun `len`(): UInt = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommembersiterator_len(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommembersiterator_len(it, _status) } @@ -8822,8 +8857,8 @@ open class RoomMembersIterator : FFIObject, RoomMembersIteratorInterface { override fun `nextChunk`(`chunkSize`: UInt): List? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommembersiterator_next_chunk(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommembersiterator_next_chunk(it, FfiConverterUInt.lower(`chunkSize`), _status) } @@ -8887,32 +8922,30 @@ open class RoomMessageEventContentWithoutRelation : FFIObject, RoomMessageEventC */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_roommessageeventcontentwithoutrelation(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_roommessageeventcontentwithoutrelation(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_roommessageeventcontentwithoutrelation(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_roommessageeventcontentwithoutrelation(pointer!!, status) } } override fun `withMentions`(`mentions`: Mentions): RoomMessageEventContentWithoutRelation = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommessageeventcontentwithoutrelation_with_mentions(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roommessageeventcontentwithoutrelation_with_mentions(it, FfiConverterTypeMentions.lower(`mentions`), _status) } @@ -8978,32 +9011,30 @@ open class SendAttachmentJoinHandle : FFIObject, SendAttachmentJoinHandleInterfa */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_sendattachmentjoinhandle(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_sendattachmentjoinhandle(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_sendattachmentjoinhandle(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_sendattachmentjoinhandle(pointer!!, status) } } override fun `cancel`() = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sendattachmentjoinhandle_cancel(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sendattachmentjoinhandle_cancel(it, _status) } @@ -9016,14 +9047,14 @@ open class SendAttachmentJoinHandle : FFIObject, SendAttachmentJoinHandleInterfa override suspend fun `join`() { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sendattachmentjoinhandle_join( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sendattachmentjoinhandle_join( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, @@ -9099,25 +9130,23 @@ open class SessionVerificationController : FFIObject, SessionVerificationControl */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_sessionverificationcontroller(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_sessionverificationcontroller(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_sessionverificationcontroller(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_sessionverificationcontroller(pointer!!, status) } } @@ -9127,14 +9156,14 @@ open class SessionVerificationController : FFIObject, SessionVerificationControl override suspend fun `approveVerification`() { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sessionverificationcontroller_approve_verification( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sessionverificationcontroller_approve_verification( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, @@ -9148,14 +9177,14 @@ open class SessionVerificationController : FFIObject, SessionVerificationControl override suspend fun `cancelVerification`() { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sessionverificationcontroller_cancel_verification( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sessionverificationcontroller_cancel_verification( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, @@ -9169,14 +9198,14 @@ open class SessionVerificationController : FFIObject, SessionVerificationControl override suspend fun `declineVerification`() { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sessionverificationcontroller_decline_verification( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sessionverificationcontroller_decline_verification( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, @@ -9190,14 +9219,14 @@ open class SessionVerificationController : FFIObject, SessionVerificationControl override suspend fun `isVerified`() : Boolean { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sessionverificationcontroller_is_verified( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sessionverificationcontroller_is_verified( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, // lift function { FfiConverterBoolean.lift(it) }, // Error FFI converter @@ -9210,14 +9239,14 @@ open class SessionVerificationController : FFIObject, SessionVerificationControl override suspend fun `requestVerification`() { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sessionverificationcontroller_request_verification( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sessionverificationcontroller_request_verification( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, @@ -9227,8 +9256,8 @@ open class SessionVerificationController : FFIObject, SessionVerificationControl } override fun `setDelegate`(`delegate`: SessionVerificationControllerDelegate?) = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sessionverificationcontroller_set_delegate(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sessionverificationcontroller_set_delegate(it, FfiConverterOptionalTypeSessionVerificationControllerDelegate.lower(`delegate`), _status) } @@ -9241,14 +9270,14 @@ open class SessionVerificationController : FFIObject, SessionVerificationControl override suspend fun `startSasVerification`() { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sessionverificationcontroller_start_sas_verification( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sessionverificationcontroller_start_sas_verification( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, @@ -9314,32 +9343,30 @@ open class SessionVerificationEmoji : FFIObject, SessionVerificationEmojiInterfa */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_sessionverificationemoji(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_sessionverificationemoji(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_sessionverificationemoji(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_sessionverificationemoji(pointer!!, status) } } override fun `description`(): String = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sessionverificationemoji_description(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sessionverificationemoji_description(it, _status) } @@ -9349,8 +9376,8 @@ open class SessionVerificationEmoji : FFIObject, SessionVerificationEmojiInterfa override fun `symbol`(): String = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sessionverificationemoji_symbol(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sessionverificationemoji_symbol(it, _status) } @@ -9445,36 +9472,34 @@ open class Span : FFIObject, SpanInterface { */ constructor(`file`: String, `line`: UInt?, `level`: LogLevel, `target`: String, `name`: String) : this( - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_constructor_span_new(FfiConverterString.lower(`file`),FfiConverterOptionalUInt.lower(`line`),FfiConverterTypeLogLevel.lower(`level`),FfiConverterString.lower(`target`),FfiConverterString.lower(`name`),_status) + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_constructor_span_new(FfiConverterString.lower(`file`),FfiConverterOptionalUInt.lower(`line`),FfiConverterTypeLogLevel.lower(`level`),FfiConverterString.lower(`target`),FfiConverterString.lower(`name`),_status) }) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_span(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_span(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_span(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_span(pointer!!, status) } } override fun `enter`() = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_span_enter(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_span_enter(it, _status) } @@ -9483,8 +9508,8 @@ open class Span : FFIObject, SpanInterface { override fun `exit`() = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_span_exit(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_span_exit(it, _status) } @@ -9493,8 +9518,8 @@ open class Span : FFIObject, SpanInterface { override fun `isNone`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_span_is_none(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_span_is_none(it, _status) } @@ -9508,8 +9533,8 @@ open class Span : FFIObject, SpanInterface { fun `current`(): Span = Span( - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_constructor_span_current(_status) + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_constructor_span_current(_status) }) } @@ -9571,32 +9596,30 @@ open class SyncService : FFIObject, SyncServiceInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_syncservice(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_syncservice(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_syncservice(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_syncservice(pointer!!, status) } } override fun `roomListService`(): RoomListService = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_syncservice_room_list_service(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_syncservice_room_list_service(it, _status) } @@ -9609,25 +9632,25 @@ open class SyncService : FFIObject, SyncServiceInterface { override suspend fun `start`() { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_syncservice_start( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_syncservice_start( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, // Error FFI converter - NullCallStatusErrorHandler, + UniffiNullRustCallStatusErrorHandler, ) } override fun `state`(`listener`: SyncServiceStateObserver): TaskHandle = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_syncservice_state(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_syncservice_state(it, FfiConverterTypeSyncServiceStateObserver.lower(`listener`), _status) } @@ -9641,14 +9664,14 @@ open class SyncService : FFIObject, SyncServiceInterface { override suspend fun `stop`() { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_syncservice_stop( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_syncservice_stop( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, @@ -9714,25 +9737,23 @@ open class SyncServiceBuilder : FFIObject, SyncServiceBuilderInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_syncservicebuilder(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_syncservicebuilder(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_syncservicebuilder(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_syncservicebuilder(pointer!!, status) } } @@ -9742,14 +9763,14 @@ open class SyncServiceBuilder : FFIObject, SyncServiceBuilderInterface { override suspend fun `finish`() : SyncService { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_syncservicebuilder_finish( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_syncservicebuilder_finish( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, // lift function { FfiConverterTypeSyncService.lift(it) }, // Error FFI converter @@ -9758,8 +9779,8 @@ open class SyncServiceBuilder : FFIObject, SyncServiceBuilderInterface { } override fun `withCrossProcessLock`(`appIdentifier`: String?): SyncServiceBuilder = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_syncservicebuilder_with_cross_process_lock(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_syncservicebuilder_with_cross_process_lock(it, FfiConverterOptionalString.lower(`appIdentifier`), _status) } @@ -9840,32 +9861,30 @@ open class TaskHandle : FFIObject, TaskHandleInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_taskhandle(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_taskhandle(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_taskhandle(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_taskhandle(pointer!!, status) } } override fun `cancel`() = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_taskhandle_cancel(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_taskhandle_cancel(it, _status) } @@ -9877,8 +9896,8 @@ open class TaskHandle : FFIObject, TaskHandleInterface { * Check whether the handle is finished. */override fun `isFinished`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_taskhandle_is_finished(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_taskhandle_is_finished(it, _status) } @@ -9995,25 +10014,23 @@ open class Timeline : FFIObject, TimelineInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_timeline(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_timeline(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_timeline(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_timeline(pointer!!, status) } } @@ -10022,24 +10039,24 @@ open class Timeline : FFIObject, TimelineInterface { override suspend fun `addListener`(`listener`: TimelineListener) : RoomTimelineListenerResult { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_add_listener( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_add_listener( thisPtr, FfiConverterTypeTimelineListener.lower(`listener`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterTypeRoomTimelineListenerResult.lift(it) }, // Error FFI converter - NullCallStatusErrorHandler, + UniffiNullRustCallStatusErrorHandler, ) } override fun `cancelSend`(`txnId`: String) = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_cancel_send(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_cancel_send(it, FfiConverterString.lower(`txnId`), _status) } @@ -10049,8 +10066,8 @@ open class Timeline : FFIObject, TimelineInterface { @Throws(ClientException::class)override fun `createPoll`(`question`: String, `answers`: List, `maxSelections`: UByte, `pollKind`: PollKind) = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_create_poll(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_create_poll(it, FfiConverterString.lower(`question`),FfiConverterSequenceString.lower(`answers`),FfiConverterUByte.lower(`maxSelections`),FfiConverterTypePollKind.lower(`pollKind`), _status) } @@ -10060,8 +10077,8 @@ open class Timeline : FFIObject, TimelineInterface { @Throws(ClientException::class)override fun `edit`(`newContent`: RoomMessageEventContentWithoutRelation, `editItem`: EventTimelineItem) = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_edit(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_edit(it, FfiConverterTypeRoomMessageEventContentWithoutRelation.lower(`newContent`),FfiConverterTypeEventTimelineItem.lower(`editItem`), _status) } @@ -10074,14 +10091,14 @@ open class Timeline : FFIObject, TimelineInterface { override suspend fun `editPoll`(`question`: String, `answers`: List, `maxSelections`: UByte, `pollKind`: PollKind, `editItem`: EventTimelineItem) { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_edit_poll( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_edit_poll( thisPtr, FfiConverterString.lower(`question`),FfiConverterSequenceString.lower(`answers`),FfiConverterUByte.lower(`maxSelections`),FfiConverterTypePollKind.lower(`pollKind`),FfiConverterTypeEventTimelineItem.lower(`editItem`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, @@ -10092,8 +10109,8 @@ open class Timeline : FFIObject, TimelineInterface { @Throws(ClientException::class)override fun `endPoll`(`pollStartId`: String, `text`: String) = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_end_poll(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_end_poll(it, FfiConverterString.lower(`pollStartId`),FfiConverterString.lower(`text`), _status) } @@ -10103,8 +10120,8 @@ open class Timeline : FFIObject, TimelineInterface { @Throws(ClientException::class)override fun `fetchDetailsForEvent`(`eventId`: String) = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_fetch_details_for_event(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_fetch_details_for_event(it, FfiConverterString.lower(`eventId`), _status) } @@ -10116,26 +10133,26 @@ open class Timeline : FFIObject, TimelineInterface { override suspend fun `fetchMembers`() { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_fetch_members( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_fetch_members( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, // Error FFI converter - NullCallStatusErrorHandler, + UniffiNullRustCallStatusErrorHandler, ) } @Throws(ClientException::class)override fun `getEventTimelineItemByEventId`(`eventId`: String): EventTimelineItem = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_get_event_timeline_item_by_event_id(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_get_event_timeline_item_by_event_id(it, FfiConverterString.lower(`eventId`), _status) } @@ -10146,8 +10163,8 @@ open class Timeline : FFIObject, TimelineInterface { @Throws(ClientException::class)override fun `getTimelineEventContentByEventId`(`eventId`: String): RoomMessageEventContentWithoutRelation = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_get_timeline_event_content_by_event_id(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_get_timeline_event_content_by_event_id(it, FfiConverterString.lower(`eventId`), _status) } @@ -10163,8 +10180,8 @@ open class Timeline : FFIObject, TimelineInterface { */ @Throws(ClientException::class)override fun `paginateBackwards`(`opts`: PaginationOptions) = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_paginate_backwards(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_paginate_backwards(it, FfiConverterTypePaginationOptions.lower(`opts`), _status) } @@ -10173,8 +10190,8 @@ open class Timeline : FFIObject, TimelineInterface { override fun `retryDecryption`(`sessionIds`: List) = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_retry_decryption(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_retry_decryption(it, FfiConverterSequenceString.lower(`sessionIds`), _status) } @@ -10183,8 +10200,8 @@ open class Timeline : FFIObject, TimelineInterface { override fun `retrySend`(`txnId`: String) = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_retry_send(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_retry_send(it, FfiConverterString.lower(`txnId`), _status) } @@ -10193,8 +10210,8 @@ open class Timeline : FFIObject, TimelineInterface { override fun `send`(`msg`: RoomMessageEventContentWithoutRelation) = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_send(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_send(it, FfiConverterTypeRoomMessageEventContentWithoutRelation.lower(`msg`), _status) } @@ -10203,8 +10220,8 @@ open class Timeline : FFIObject, TimelineInterface { override fun `sendAudio`(`url`: String, `audioInfo`: AudioInfo, `progressWatcher`: ProgressWatcher?): SendAttachmentJoinHandle = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_send_audio(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_send_audio(it, FfiConverterString.lower(`url`),FfiConverterTypeAudioInfo.lower(`audioInfo`),FfiConverterOptionalTypeProgressWatcher.lower(`progressWatcher`), _status) } @@ -10214,8 +10231,8 @@ open class Timeline : FFIObject, TimelineInterface { override fun `sendFile`(`url`: String, `fileInfo`: FileInfo, `progressWatcher`: ProgressWatcher?): SendAttachmentJoinHandle = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_send_file(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_send_file(it, FfiConverterString.lower(`url`),FfiConverterTypeFileInfo.lower(`fileInfo`),FfiConverterOptionalTypeProgressWatcher.lower(`progressWatcher`), _status) } @@ -10225,8 +10242,8 @@ open class Timeline : FFIObject, TimelineInterface { override fun `sendImage`(`url`: String, `thumbnailUrl`: String?, `imageInfo`: ImageInfo, `progressWatcher`: ProgressWatcher?): SendAttachmentJoinHandle = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_send_image(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_send_image(it, FfiConverterString.lower(`url`),FfiConverterOptionalString.lower(`thumbnailUrl`),FfiConverterTypeImageInfo.lower(`imageInfo`),FfiConverterOptionalTypeProgressWatcher.lower(`progressWatcher`), _status) } @@ -10236,8 +10253,8 @@ open class Timeline : FFIObject, TimelineInterface { override fun `sendLocation`(`body`: String, `geoUri`: String, `description`: String?, `zoomLevel`: UByte?, `assetType`: AssetType?) = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_send_location(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_send_location(it, FfiConverterString.lower(`body`),FfiConverterString.lower(`geoUri`),FfiConverterOptionalString.lower(`description`),FfiConverterOptionalUByte.lower(`zoomLevel`),FfiConverterOptionalTypeAssetType.lower(`assetType`), _status) } @@ -10247,8 +10264,8 @@ open class Timeline : FFIObject, TimelineInterface { @Throws(ClientException::class)override fun `sendPollResponse`(`pollStartId`: String, `answers`: List) = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_send_poll_response(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_send_poll_response(it, FfiConverterString.lower(`pollStartId`),FfiConverterSequenceString.lower(`answers`), _status) } @@ -10258,8 +10275,8 @@ open class Timeline : FFIObject, TimelineInterface { @Throws(ClientException::class)override fun `sendReadReceipt`(`receiptType`: ReceiptType, `eventId`: String) = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_send_read_receipt(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_send_read_receipt(it, FfiConverterTypeReceiptType.lower(`receiptType`),FfiConverterString.lower(`eventId`), _status) } @@ -10269,8 +10286,8 @@ open class Timeline : FFIObject, TimelineInterface { @Throws(ClientException::class)override fun `sendReply`(`msg`: RoomMessageEventContentWithoutRelation, `replyItem`: EventTimelineItem) = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_send_reply(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_send_reply(it, FfiConverterTypeRoomMessageEventContentWithoutRelation.lower(`msg`),FfiConverterTypeEventTimelineItem.lower(`replyItem`), _status) } @@ -10279,8 +10296,8 @@ open class Timeline : FFIObject, TimelineInterface { override fun `sendVideo`(`url`: String, `thumbnailUrl`: String?, `videoInfo`: VideoInfo, `progressWatcher`: ProgressWatcher?): SendAttachmentJoinHandle = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_send_video(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_send_video(it, FfiConverterString.lower(`url`),FfiConverterOptionalString.lower(`thumbnailUrl`),FfiConverterTypeVideoInfo.lower(`videoInfo`),FfiConverterOptionalTypeProgressWatcher.lower(`progressWatcher`), _status) } @@ -10290,8 +10307,8 @@ open class Timeline : FFIObject, TimelineInterface { override fun `sendVoiceMessage`(`url`: String, `audioInfo`: AudioInfo, `waveform`: List, `progressWatcher`: ProgressWatcher?): SendAttachmentJoinHandle = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_send_voice_message(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_send_voice_message(it, FfiConverterString.lower(`url`),FfiConverterTypeAudioInfo.lower(`audioInfo`),FfiConverterSequenceUShort.lower(`waveform`),FfiConverterOptionalTypeProgressWatcher.lower(`progressWatcher`), _status) } @@ -10302,8 +10319,8 @@ open class Timeline : FFIObject, TimelineInterface { @Throws(ClientException::class)override fun `subscribeToBackPaginationStatus`(`listener`: BackPaginationStatusListener): TaskHandle = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_subscribe_to_back_pagination_status(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_subscribe_to_back_pagination_status(it, FfiConverterTypeBackPaginationStatusListener.lower(`listener`), _status) } @@ -10314,8 +10331,8 @@ open class Timeline : FFIObject, TimelineInterface { @Throws(ClientException::class)override fun `toggleReaction`(`eventId`: String, `key`: String) = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_toggle_reaction(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_toggle_reaction(it, FfiConverterString.lower(`eventId`),FfiConverterString.lower(`key`), _status) } @@ -10392,32 +10409,30 @@ open class TimelineDiff : FFIObject, TimelineDiffInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_timelinediff(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_timelinediff(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_timelinediff(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_timelinediff(pointer!!, status) } } override fun `append`(): List? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelinediff_append(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelinediff_append(it, _status) } @@ -10427,8 +10442,8 @@ open class TimelineDiff : FFIObject, TimelineDiffInterface { override fun `change`(): TimelineChange = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelinediff_change(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelinediff_change(it, _status) } @@ -10438,8 +10453,8 @@ open class TimelineDiff : FFIObject, TimelineDiffInterface { override fun `insert`(): InsertData? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelinediff_insert(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelinediff_insert(it, _status) } @@ -10449,8 +10464,8 @@ open class TimelineDiff : FFIObject, TimelineDiffInterface { override fun `pushBack`(): TimelineItem? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelinediff_push_back(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelinediff_push_back(it, _status) } @@ -10460,8 +10475,8 @@ open class TimelineDiff : FFIObject, TimelineDiffInterface { override fun `pushFront`(): TimelineItem? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelinediff_push_front(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelinediff_push_front(it, _status) } @@ -10471,8 +10486,8 @@ open class TimelineDiff : FFIObject, TimelineDiffInterface { override fun `remove`(): UInt? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelinediff_remove(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelinediff_remove(it, _status) } @@ -10482,8 +10497,8 @@ open class TimelineDiff : FFIObject, TimelineDiffInterface { override fun `reset`(): List? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelinediff_reset(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelinediff_reset(it, _status) } @@ -10493,8 +10508,8 @@ open class TimelineDiff : FFIObject, TimelineDiffInterface { override fun `set`(): SetData? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelinediff_set(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelinediff_set(it, _status) } @@ -10564,32 +10579,30 @@ open class TimelineEvent : FFIObject, TimelineEventInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_timelineevent(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_timelineevent(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_timelineevent(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_timelineevent(pointer!!, status) } } override fun `eventId`(): String = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelineevent_event_id(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelineevent_event_id(it, _status) } @@ -10600,8 +10613,8 @@ open class TimelineEvent : FFIObject, TimelineEventInterface { @Throws(ClientException::class)override fun `eventType`(): TimelineEventType = callWithPointer { - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelineevent_event_type(it, + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelineevent_event_type(it, _status) } @@ -10611,8 +10624,8 @@ open class TimelineEvent : FFIObject, TimelineEventInterface { override fun `senderId`(): String = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelineevent_sender_id(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelineevent_sender_id(it, _status) } @@ -10622,8 +10635,8 @@ open class TimelineEvent : FFIObject, TimelineEventInterface { override fun `timestamp`(): ULong = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelineevent_timestamp(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelineevent_timestamp(it, _status) } @@ -10693,32 +10706,30 @@ open class TimelineItem : FFIObject, TimelineItemInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_timelineitem(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_timelineitem(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_timelineitem(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_timelineitem(pointer!!, status) } } override fun `asEvent`(): EventTimelineItem? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelineitem_as_event(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelineitem_as_event(it, _status) } @@ -10728,8 +10739,8 @@ open class TimelineItem : FFIObject, TimelineItemInterface { override fun `asVirtual`(): VirtualTimelineItem? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelineitem_as_virtual(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelineitem_as_virtual(it, _status) } @@ -10739,8 +10750,8 @@ open class TimelineItem : FFIObject, TimelineItemInterface { override fun `fmtDebug`(): String = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelineitem_fmt_debug(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelineitem_fmt_debug(it, _status) } @@ -10750,8 +10761,8 @@ open class TimelineItem : FFIObject, TimelineItemInterface { override fun `uniqueId`(): ULong = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelineitem_unique_id(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelineitem_unique_id(it, _status) } @@ -10817,32 +10828,30 @@ open class TimelineItemContent : FFIObject, TimelineItemContentInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_timelineitemcontent(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_timelineitemcontent(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_timelineitemcontent(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_timelineitemcontent(pointer!!, status) } } override fun `asMessage`(): Message? = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelineitemcontent_as_message(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelineitemcontent_as_message(it, _status) } @@ -10852,8 +10861,8 @@ open class TimelineItemContent : FFIObject, TimelineItemContentInterface { override fun `kind`(): TimelineItemContentKind = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelineitemcontent_kind(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelineitemcontent_kind(it, _status) } @@ -10921,32 +10930,30 @@ open class UnreadNotificationsCount : FFIObject, UnreadNotificationsCountInterfa */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_unreadnotificationscount(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_unreadnotificationscount(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_unreadnotificationscount(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_unreadnotificationscount(pointer!!, status) } } override fun `hasNotifications`(): Boolean = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_unreadnotificationscount_has_notifications(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_unreadnotificationscount_has_notifications(it, _status) } @@ -10956,8 +10963,8 @@ open class UnreadNotificationsCount : FFIObject, UnreadNotificationsCountInterfa override fun `highlightCount`(): UInt = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_unreadnotificationscount_highlight_count(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_unreadnotificationscount_highlight_count(it, _status) } @@ -10967,8 +10974,8 @@ open class UnreadNotificationsCount : FFIObject, UnreadNotificationsCountInterfa override fun `notificationCount`(): UInt = callWithPointer { - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_unreadnotificationscount_notification_count(it, + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_unreadnotificationscount_notification_count(it, _status) } @@ -11040,25 +11047,23 @@ open class WidgetDriver : FFIObject, WidgetDriverInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_widgetdriver(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_widgetdriver(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_widgetdriver(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_widgetdriver(pointer!!, status) } } @@ -11067,19 +11072,19 @@ open class WidgetDriver : FFIObject, WidgetDriverInterface { override suspend fun `run`(`room`: Room, `capabilitiesProvider`: WidgetCapabilitiesProvider) { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_widgetdriver_run( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_widgetdriver_run( thisPtr, FfiConverterTypeRoom.lower(`room`),FfiConverterTypeWidgetCapabilitiesProvider.lower(`capabilitiesProvider`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, // lift function { Unit }, // Error FFI converter - NullCallStatusErrorHandler, + UniffiNullRustCallStatusErrorHandler, ) } @@ -11159,25 +11164,23 @@ open class WidgetDriverHandle : FFIObject, WidgetDriverHandleInterface { */ constructor(noPointer: NoPointer): super(noPointer) - override fun uniffiClonePointer(): Pointer { - return rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_widgetdriverhandle(pointer!!, status) + override val cleanable: UniffiCleaner.Cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + // 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 { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_widgetdriverhandle(ptr, status) + } + } } } - /** - * Disconnect the object from the underlying Rust object. - * - * It can be called more than once, but once called, interacting with the object - * causes an `IllegalStateException`. - * - * Clients **must** call this method once done with the object, or cause a memory leak. - */ - override protected fun freeRustArcPtr() { - this.pointer?.let { ptr -> - rustCall() { status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_widgetdriverhandle(ptr, status) - } + override fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_widgetdriverhandle(pointer!!, status) } } @@ -11193,18 +11196,18 @@ open class WidgetDriverHandle : FFIObject, WidgetDriverHandleInterface { override suspend fun `recv`() : String? { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_widgetdriverhandle_recv( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_widgetdriverhandle_recv( thisPtr, ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterOptionalString.lift(it) }, // Error FFI converter - NullCallStatusErrorHandler, + UniffiNullRustCallStatusErrorHandler, ) } @@ -11216,18 +11219,18 @@ open class WidgetDriverHandle : FFIObject, WidgetDriverHandleInterface { override suspend fun `send`(`msg`: String) : Boolean { return uniffiRustCallAsync( callWithPointer { thisPtr -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_widgetdriverhandle_send( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_widgetdriverhandle_send( thisPtr, FfiConverterString.lower(`msg`), ) }, - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, // lift function { FfiConverterBoolean.lift(it) }, // Error FFI converter - NullCallStatusErrorHandler, + UniffiNullRustCallStatusErrorHandler, ) } @@ -13807,7 +13810,7 @@ sealed class AuthenticationException(message: String): Exception(message) { class Generic(message: String) : AuthenticationException(message) - companion object ErrorHandler : CallStatusErrorHandler { + companion object ErrorHandler : UniffiRustCallStatusErrorHandler { override fun lift(error_buf: RustBuffer.ByValue): AuthenticationException = FfiConverterTypeAuthenticationError.lift(error_buf) } } @@ -14033,7 +14036,7 @@ sealed class ClientException: Exception() { } - companion object ErrorHandler : CallStatusErrorHandler { + companion object ErrorHandler : UniffiRustCallStatusErrorHandler { override fun lift(error_buf: RustBuffer.ByValue): ClientException = FfiConverterTypeClientError.lift(error_buf) } @@ -14539,52 +14542,31 @@ public object FfiConverterTypeLogLevel: FfiConverterRustBuffer { - - -sealed class MediaInfoException(message: String): Exception(message) { - - class MissingField(message: String) : MediaInfoException(message) - - class InvalidField(message: String) : MediaInfoException(message) - - - companion object ErrorHandler : CallStatusErrorHandler { - override fun lift(error_buf: RustBuffer.ByValue): MediaInfoException = FfiConverterTypeMediaInfoError.lift(error_buf) - } +enum class MediaInfoError { + + MISSING_FIELD, + INVALID_FIELD; + companion object } -public object FfiConverterTypeMediaInfoError : FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): MediaInfoException { - - return when(buf.getInt()) { - 1 -> MediaInfoException.MissingField(FfiConverterString.read(buf)) - 2 -> MediaInfoException.InvalidField(FfiConverterString.read(buf)) - else -> throw RuntimeException("invalid error enum value, something is very wrong!!") - } - +public object FfiConverterTypeMediaInfoError: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer) = try { + MediaInfoError.values()[buf.getInt() - 1] + } catch (e: IndexOutOfBoundsException) { + throw RuntimeException("invalid enum value, something is very wrong!!", e) } - override fun allocationSize(value: MediaInfoException): Int { - return 4 - } + override fun allocationSize(value: MediaInfoError) = 4 - override fun write(value: MediaInfoException, buf: ByteBuffer) { - when(value) { - is MediaInfoException.MissingField -> { - buf.putInt(1) - Unit - } - is MediaInfoException.InvalidField -> { - buf.putInt(2) - Unit - } - }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } + override fun write(value: MediaInfoError, buf: ByteBuffer) { + buf.putInt(value.ordinal + 1) } - } + + enum class Membership { INVITED, @@ -15682,7 +15664,7 @@ sealed class NotificationSettingsException: Exception() { } - companion object ErrorHandler : CallStatusErrorHandler { + companion object ErrorHandler : UniffiRustCallStatusErrorHandler { override fun lift(error_buf: RustBuffer.ByValue): NotificationSettingsException = FfiConverterTypeNotificationSettingsError.lift(error_buf) } @@ -16274,7 +16256,7 @@ sealed class ParseException(message: String): Exception(message) { class Other(message: String) : ParseException(message) - companion object ErrorHandler : CallStatusErrorHandler { + companion object ErrorHandler : UniffiRustCallStatusErrorHandler { override fun lift(error_buf: RustBuffer.ByValue): ParseException = FfiConverterTypeParseError.lift(error_buf) } } @@ -16643,7 +16625,7 @@ sealed class RecoveryException: Exception() { } - companion object ErrorHandler : CallStatusErrorHandler { + companion object ErrorHandler : UniffiRustCallStatusErrorHandler { override fun lift(error_buf: RustBuffer.ByValue): RecoveryException = FfiConverterTypeRecoveryError.lift(error_buf) } @@ -16885,7 +16867,7 @@ sealed class RoomException(message: String): Exception(message) { class FailedSendingAttachment(message: String) : RoomException(message) - companion object ErrorHandler : CallStatusErrorHandler { + companion object ErrorHandler : UniffiRustCallStatusErrorHandler { override fun lift(error_buf: RustBuffer.ByValue): RoomException = FfiConverterTypeRoomError.lift(error_buf) } } @@ -17438,7 +17420,7 @@ sealed class RoomListException: Exception() { } - companion object ErrorHandler : CallStatusErrorHandler { + companion object ErrorHandler : UniffiRustCallStatusErrorHandler { override fun lift(error_buf: RustBuffer.ByValue): RoomListException = FfiConverterTypeRoomListError.lift(error_buf) } @@ -18287,7 +18269,7 @@ sealed class SteadyStateException(message: String): Exception(message) { class Lagged(message: String) : SteadyStateException(message) - companion object ErrorHandler : CallStatusErrorHandler { + companion object ErrorHandler : UniffiRustCallStatusErrorHandler { override fun lift(error_buf: RustBuffer.ByValue): SteadyStateException = FfiConverterTypeSteadyStateError.lift(error_buf) } } @@ -19085,15 +19067,15 @@ public interface BackPaginationStatusListener { } -internal typealias Handle = Long +internal typealias UniffiHandle = Long internal class ConcurrentHandleMap( - private val leftMap: MutableMap = mutableMapOf(), + private val leftMap: MutableMap = mutableMapOf(), ) { private val lock = java.util.concurrent.locks.ReentrantLock() private val currentHandle = AtomicLong(0L) private val stride = 1L - fun insert(obj: T): Handle = + fun insert(obj: T): UniffiHandle = lock.withLock { currentHandle.getAndAdd(stride) .also { handle -> @@ -19101,22 +19083,22 @@ internal class ConcurrentHandleMap( } } - fun get(handle: Handle) = lock.withLock { + fun get(handle: UniffiHandle) = lock.withLock { leftMap[handle] ?: throw InternalException("No callback in handlemap; this is a Uniffi bug") } - fun delete(handle: Handle) { + fun delete(handle: UniffiHandle) { this.remove(handle) } - fun remove(handle: Handle): T? = + fun remove(handle: UniffiHandle): T? = lock.withLock { leftMap.remove(handle) } } interface ForeignCallback : com.sun.jna.Callback { - public fun invoke(handle: Handle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int + public fun invoke(handle: UniffiHandle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int } // Magic number for the Rust proxy to call using the same mechanism as every other method, @@ -19127,14 +19109,14 @@ internal const val UNIFFI_CALLBACK_SUCCESS = 0 internal const val UNIFFI_CALLBACK_ERROR = 1 internal const val UNIFFI_CALLBACK_UNEXPECTED_ERROR = 2 -public abstract class FfiConverterCallbackInterface: FfiConverter { +public abstract class FfiConverterCallbackInterface: FfiConverter { internal val handleMap = ConcurrentHandleMap() - internal fun drop(handle: Handle) { + internal fun drop(handle: UniffiHandle) { handleMap.remove(handle) } - override fun lift(value: Handle): CallbackInterface { + override fun lift(value: UniffiHandle): CallbackInterface { return handleMap.get(value) } @@ -19152,7 +19134,7 @@ public abstract class FfiConverterCallbackInterface: FfiConve // Implement the foreign callback handler for BackPaginationStatusListener internal class UniffiCallbackInterfaceBackPaginationStatusListener : ForeignCallback { @Suppress("TooGenericExceptionCaught") - override fun invoke(handle: Handle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { + override fun invoke(handle: UniffiHandle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { val cb = FfiConverterTypeBackPaginationStatusListener.handleMap.get(handle) return when (method) { IDX_CALLBACK_FREE -> { @@ -19213,14 +19195,14 @@ internal class UniffiCallbackInterfaceBackPaginationStatusListener : ForeignCall // Registers the foreign callback with the Rust side. // This method is generated for each callback interface. - internal fun register(lib: _UniFFILib) { + internal fun register(lib: UniffiLib) { lib.uniffi_matrix_sdk_ffi_fn_init_callback_backpaginationstatuslistener(this) } } internal val uniffiCallbackInterfaceBackPaginationStatusListener = UniffiCallbackInterfaceBackPaginationStatusListener() -// The ffiConverter which transforms the Callbacks in to Handles to pass to Rust. +// The ffiConverter which transforms the Callbacks in to UniffiHandles to pass to Rust. public object FfiConverterTypeBackPaginationStatusListener: FfiConverterCallbackInterface() @@ -19238,7 +19220,7 @@ public interface BackupStateListener { // Implement the foreign callback handler for BackupStateListener internal class UniffiCallbackInterfaceBackupStateListener : ForeignCallback { @Suppress("TooGenericExceptionCaught") - override fun invoke(handle: Handle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { + override fun invoke(handle: UniffiHandle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { val cb = FfiConverterTypeBackupStateListener.handleMap.get(handle) return when (method) { IDX_CALLBACK_FREE -> { @@ -19299,14 +19281,14 @@ internal class UniffiCallbackInterfaceBackupStateListener : ForeignCallback { // Registers the foreign callback with the Rust side. // This method is generated for each callback interface. - internal fun register(lib: _UniFFILib) { + internal fun register(lib: UniffiLib) { lib.uniffi_matrix_sdk_ffi_fn_init_callback_backupstatelistener(this) } } internal val uniffiCallbackInterfaceBackupStateListener = UniffiCallbackInterfaceBackupStateListener() -// The ffiConverter which transforms the Callbacks in to Handles to pass to Rust. +// The ffiConverter which transforms the Callbacks in to UniffiHandles to pass to Rust. public object FfiConverterTypeBackupStateListener: FfiConverterCallbackInterface() @@ -19324,7 +19306,7 @@ public interface BackupSteadyStateListener { // Implement the foreign callback handler for BackupSteadyStateListener internal class UniffiCallbackInterfaceBackupSteadyStateListener : ForeignCallback { @Suppress("TooGenericExceptionCaught") - override fun invoke(handle: Handle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { + override fun invoke(handle: UniffiHandle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { val cb = FfiConverterTypeBackupSteadyStateListener.handleMap.get(handle) return when (method) { IDX_CALLBACK_FREE -> { @@ -19385,14 +19367,14 @@ internal class UniffiCallbackInterfaceBackupSteadyStateListener : ForeignCallbac // Registers the foreign callback with the Rust side. // This method is generated for each callback interface. - internal fun register(lib: _UniFFILib) { + internal fun register(lib: UniffiLib) { lib.uniffi_matrix_sdk_ffi_fn_init_callback_backupsteadystatelistener(this) } } internal val uniffiCallbackInterfaceBackupSteadyStateListener = UniffiCallbackInterfaceBackupSteadyStateListener() -// The ffiConverter which transforms the Callbacks in to Handles to pass to Rust. +// The ffiConverter which transforms the Callbacks in to UniffiHandles to pass to Rust. public object FfiConverterTypeBackupSteadyStateListener: FfiConverterCallbackInterface() @@ -19412,7 +19394,7 @@ public interface ClientDelegate { // Implement the foreign callback handler for ClientDelegate internal class UniffiCallbackInterfaceClientDelegate : ForeignCallback { @Suppress("TooGenericExceptionCaught") - override fun invoke(handle: Handle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { + override fun invoke(handle: UniffiHandle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { val cb = FfiConverterTypeClientDelegate.handleMap.get(handle) return when (method) { IDX_CALLBACK_FREE -> { @@ -19501,14 +19483,14 @@ internal class UniffiCallbackInterfaceClientDelegate : ForeignCallback { // Registers the foreign callback with the Rust side. // This method is generated for each callback interface. - internal fun register(lib: _UniFFILib) { + internal fun register(lib: UniffiLib) { lib.uniffi_matrix_sdk_ffi_fn_init_callback_clientdelegate(this) } } internal val uniffiCallbackInterfaceClientDelegate = UniffiCallbackInterfaceClientDelegate() -// The ffiConverter which transforms the Callbacks in to Handles to pass to Rust. +// The ffiConverter which transforms the Callbacks in to UniffiHandles to pass to Rust. public object FfiConverterTypeClientDelegate: FfiConverterCallbackInterface() @@ -19528,7 +19510,7 @@ public interface ClientSessionDelegate { // Implement the foreign callback handler for ClientSessionDelegate internal class UniffiCallbackInterfaceClientSessionDelegate : ForeignCallback { @Suppress("TooGenericExceptionCaught") - override fun invoke(handle: Handle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { + override fun invoke(handle: UniffiHandle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { val cb = FfiConverterTypeClientSessionDelegate.handleMap.get(handle) return when (method) { IDX_CALLBACK_FREE -> { @@ -19629,14 +19611,14 @@ internal class UniffiCallbackInterfaceClientSessionDelegate : ForeignCallback { // Registers the foreign callback with the Rust side. // This method is generated for each callback interface. - internal fun register(lib: _UniFFILib) { + internal fun register(lib: UniffiLib) { lib.uniffi_matrix_sdk_ffi_fn_init_callback_clientsessiondelegate(this) } } internal val uniffiCallbackInterfaceClientSessionDelegate = UniffiCallbackInterfaceClientSessionDelegate() -// The ffiConverter which transforms the Callbacks in to Handles to pass to Rust. +// The ffiConverter which transforms the Callbacks in to UniffiHandles to pass to Rust. public object FfiConverterTypeClientSessionDelegate: FfiConverterCallbackInterface() @@ -19654,7 +19636,7 @@ public interface EnableRecoveryProgressListener { // Implement the foreign callback handler for EnableRecoveryProgressListener internal class UniffiCallbackInterfaceEnableRecoveryProgressListener : ForeignCallback { @Suppress("TooGenericExceptionCaught") - override fun invoke(handle: Handle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { + override fun invoke(handle: UniffiHandle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { val cb = FfiConverterTypeEnableRecoveryProgressListener.handleMap.get(handle) return when (method) { IDX_CALLBACK_FREE -> { @@ -19715,14 +19697,14 @@ internal class UniffiCallbackInterfaceEnableRecoveryProgressListener : ForeignCa // Registers the foreign callback with the Rust side. // This method is generated for each callback interface. - internal fun register(lib: _UniFFILib) { + internal fun register(lib: UniffiLib) { lib.uniffi_matrix_sdk_ffi_fn_init_callback_enablerecoveryprogresslistener(this) } } internal val uniffiCallbackInterfaceEnableRecoveryProgressListener = UniffiCallbackInterfaceEnableRecoveryProgressListener() -// The ffiConverter which transforms the Callbacks in to Handles to pass to Rust. +// The ffiConverter which transforms the Callbacks in to UniffiHandles to pass to Rust. public object FfiConverterTypeEnableRecoveryProgressListener: FfiConverterCallbackInterface() @@ -19743,7 +19725,7 @@ public interface NotificationSettingsDelegate { // Implement the foreign callback handler for NotificationSettingsDelegate internal class UniffiCallbackInterfaceNotificationSettingsDelegate : ForeignCallback { @Suppress("TooGenericExceptionCaught") - override fun invoke(handle: Handle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { + override fun invoke(handle: UniffiHandle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { val cb = FfiConverterTypeNotificationSettingsDelegate.handleMap.get(handle) return when (method) { IDX_CALLBACK_FREE -> { @@ -19800,14 +19782,14 @@ internal class UniffiCallbackInterfaceNotificationSettingsDelegate : ForeignCall // Registers the foreign callback with the Rust side. // This method is generated for each callback interface. - internal fun register(lib: _UniFFILib) { + internal fun register(lib: UniffiLib) { lib.uniffi_matrix_sdk_ffi_fn_init_callback_notificationsettingsdelegate(this) } } internal val uniffiCallbackInterfaceNotificationSettingsDelegate = UniffiCallbackInterfaceNotificationSettingsDelegate() -// The ffiConverter which transforms the Callbacks in to Handles to pass to Rust. +// The ffiConverter which transforms the Callbacks in to UniffiHandles to pass to Rust. public object FfiConverterTypeNotificationSettingsDelegate: FfiConverterCallbackInterface() @@ -19825,7 +19807,7 @@ public interface ProgressWatcher { // Implement the foreign callback handler for ProgressWatcher internal class UniffiCallbackInterfaceProgressWatcher : ForeignCallback { @Suppress("TooGenericExceptionCaught") - override fun invoke(handle: Handle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { + override fun invoke(handle: UniffiHandle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { val cb = FfiConverterTypeProgressWatcher.handleMap.get(handle) return when (method) { IDX_CALLBACK_FREE -> { @@ -19886,14 +19868,14 @@ internal class UniffiCallbackInterfaceProgressWatcher : ForeignCallback { // Registers the foreign callback with the Rust side. // This method is generated for each callback interface. - internal fun register(lib: _UniFFILib) { + internal fun register(lib: UniffiLib) { lib.uniffi_matrix_sdk_ffi_fn_init_callback_progresswatcher(this) } } internal val uniffiCallbackInterfaceProgressWatcher = UniffiCallbackInterfaceProgressWatcher() -// The ffiConverter which transforms the Callbacks in to Handles to pass to Rust. +// The ffiConverter which transforms the Callbacks in to UniffiHandles to pass to Rust. public object FfiConverterTypeProgressWatcher: FfiConverterCallbackInterface() @@ -19911,7 +19893,7 @@ public interface RecoveryStateListener { // Implement the foreign callback handler for RecoveryStateListener internal class UniffiCallbackInterfaceRecoveryStateListener : ForeignCallback { @Suppress("TooGenericExceptionCaught") - override fun invoke(handle: Handle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { + override fun invoke(handle: UniffiHandle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { val cb = FfiConverterTypeRecoveryStateListener.handleMap.get(handle) return when (method) { IDX_CALLBACK_FREE -> { @@ -19972,14 +19954,14 @@ internal class UniffiCallbackInterfaceRecoveryStateListener : ForeignCallback { // Registers the foreign callback with the Rust side. // This method is generated for each callback interface. - internal fun register(lib: _UniFFILib) { + internal fun register(lib: UniffiLib) { lib.uniffi_matrix_sdk_ffi_fn_init_callback_recoverystatelistener(this) } } internal val uniffiCallbackInterfaceRecoveryStateListener = UniffiCallbackInterfaceRecoveryStateListener() -// The ffiConverter which transforms the Callbacks in to Handles to pass to Rust. +// The ffiConverter which transforms the Callbacks in to UniffiHandles to pass to Rust. public object FfiConverterTypeRecoveryStateListener: FfiConverterCallbackInterface() @@ -19997,7 +19979,7 @@ public interface RoomInfoListener { // Implement the foreign callback handler for RoomInfoListener internal class UniffiCallbackInterfaceRoomInfoListener : ForeignCallback { @Suppress("TooGenericExceptionCaught") - override fun invoke(handle: Handle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { + override fun invoke(handle: UniffiHandle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { val cb = FfiConverterTypeRoomInfoListener.handleMap.get(handle) return when (method) { IDX_CALLBACK_FREE -> { @@ -20058,14 +20040,14 @@ internal class UniffiCallbackInterfaceRoomInfoListener : ForeignCallback { // Registers the foreign callback with the Rust side. // This method is generated for each callback interface. - internal fun register(lib: _UniFFILib) { + internal fun register(lib: UniffiLib) { lib.uniffi_matrix_sdk_ffi_fn_init_callback_roominfolistener(this) } } internal val uniffiCallbackInterfaceRoomInfoListener = UniffiCallbackInterfaceRoomInfoListener() -// The ffiConverter which transforms the Callbacks in to Handles to pass to Rust. +// The ffiConverter which transforms the Callbacks in to UniffiHandles to pass to Rust. public object FfiConverterTypeRoomInfoListener: FfiConverterCallbackInterface() @@ -20083,7 +20065,7 @@ public interface RoomListEntriesListener { // Implement the foreign callback handler for RoomListEntriesListener internal class UniffiCallbackInterfaceRoomListEntriesListener : ForeignCallback { @Suppress("TooGenericExceptionCaught") - override fun invoke(handle: Handle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { + override fun invoke(handle: UniffiHandle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { val cb = FfiConverterTypeRoomListEntriesListener.handleMap.get(handle) return when (method) { IDX_CALLBACK_FREE -> { @@ -20144,14 +20126,14 @@ internal class UniffiCallbackInterfaceRoomListEntriesListener : ForeignCallback // Registers the foreign callback with the Rust side. // This method is generated for each callback interface. - internal fun register(lib: _UniFFILib) { + internal fun register(lib: UniffiLib) { lib.uniffi_matrix_sdk_ffi_fn_init_callback_roomlistentrieslistener(this) } } internal val uniffiCallbackInterfaceRoomListEntriesListener = UniffiCallbackInterfaceRoomListEntriesListener() -// The ffiConverter which transforms the Callbacks in to Handles to pass to Rust. +// The ffiConverter which transforms the Callbacks in to UniffiHandles to pass to Rust. public object FfiConverterTypeRoomListEntriesListener: FfiConverterCallbackInterface() @@ -20169,7 +20151,7 @@ public interface RoomListLoadingStateListener { // Implement the foreign callback handler for RoomListLoadingStateListener internal class UniffiCallbackInterfaceRoomListLoadingStateListener : ForeignCallback { @Suppress("TooGenericExceptionCaught") - override fun invoke(handle: Handle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { + override fun invoke(handle: UniffiHandle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { val cb = FfiConverterTypeRoomListLoadingStateListener.handleMap.get(handle) return when (method) { IDX_CALLBACK_FREE -> { @@ -20230,14 +20212,14 @@ internal class UniffiCallbackInterfaceRoomListLoadingStateListener : ForeignCall // Registers the foreign callback with the Rust side. // This method is generated for each callback interface. - internal fun register(lib: _UniFFILib) { + internal fun register(lib: UniffiLib) { lib.uniffi_matrix_sdk_ffi_fn_init_callback_roomlistloadingstatelistener(this) } } internal val uniffiCallbackInterfaceRoomListLoadingStateListener = UniffiCallbackInterfaceRoomListLoadingStateListener() -// The ffiConverter which transforms the Callbacks in to Handles to pass to Rust. +// The ffiConverter which transforms the Callbacks in to UniffiHandles to pass to Rust. public object FfiConverterTypeRoomListLoadingStateListener: FfiConverterCallbackInterface() @@ -20255,7 +20237,7 @@ public interface RoomListServiceStateListener { // Implement the foreign callback handler for RoomListServiceStateListener internal class UniffiCallbackInterfaceRoomListServiceStateListener : ForeignCallback { @Suppress("TooGenericExceptionCaught") - override fun invoke(handle: Handle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { + override fun invoke(handle: UniffiHandle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { val cb = FfiConverterTypeRoomListServiceStateListener.handleMap.get(handle) return when (method) { IDX_CALLBACK_FREE -> { @@ -20316,14 +20298,14 @@ internal class UniffiCallbackInterfaceRoomListServiceStateListener : ForeignCall // Registers the foreign callback with the Rust side. // This method is generated for each callback interface. - internal fun register(lib: _UniFFILib) { + internal fun register(lib: UniffiLib) { lib.uniffi_matrix_sdk_ffi_fn_init_callback_roomlistservicestatelistener(this) } } internal val uniffiCallbackInterfaceRoomListServiceStateListener = UniffiCallbackInterfaceRoomListServiceStateListener() -// The ffiConverter which transforms the Callbacks in to Handles to pass to Rust. +// The ffiConverter which transforms the Callbacks in to UniffiHandles to pass to Rust. public object FfiConverterTypeRoomListServiceStateListener: FfiConverterCallbackInterface() @@ -20341,7 +20323,7 @@ public interface RoomListServiceSyncIndicatorListener { // Implement the foreign callback handler for RoomListServiceSyncIndicatorListener internal class UniffiCallbackInterfaceRoomListServiceSyncIndicatorListener : ForeignCallback { @Suppress("TooGenericExceptionCaught") - override fun invoke(handle: Handle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { + override fun invoke(handle: UniffiHandle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { val cb = FfiConverterTypeRoomListServiceSyncIndicatorListener.handleMap.get(handle) return when (method) { IDX_CALLBACK_FREE -> { @@ -20402,14 +20384,14 @@ internal class UniffiCallbackInterfaceRoomListServiceSyncIndicatorListener : For // Registers the foreign callback with the Rust side. // This method is generated for each callback interface. - internal fun register(lib: _UniFFILib) { + internal fun register(lib: UniffiLib) { lib.uniffi_matrix_sdk_ffi_fn_init_callback_roomlistservicesyncindicatorlistener(this) } } internal val uniffiCallbackInterfaceRoomListServiceSyncIndicatorListener = UniffiCallbackInterfaceRoomListServiceSyncIndicatorListener() -// The ffiConverter which transforms the Callbacks in to Handles to pass to Rust. +// The ffiConverter which transforms the Callbacks in to UniffiHandles to pass to Rust. public object FfiConverterTypeRoomListServiceSyncIndicatorListener: FfiConverterCallbackInterface() @@ -20437,7 +20419,7 @@ public interface SessionVerificationControllerDelegate { // Implement the foreign callback handler for SessionVerificationControllerDelegate internal class UniffiCallbackInterfaceSessionVerificationControllerDelegate : ForeignCallback { @Suppress("TooGenericExceptionCaught") - override fun invoke(handle: Handle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { + override fun invoke(handle: UniffiHandle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { val cb = FfiConverterTypeSessionVerificationControllerDelegate.handleMap.get(handle) return when (method) { IDX_CALLBACK_FREE -> { @@ -20638,14 +20620,14 @@ internal class UniffiCallbackInterfaceSessionVerificationControllerDelegate : Fo // Registers the foreign callback with the Rust side. // This method is generated for each callback interface. - internal fun register(lib: _UniFFILib) { + internal fun register(lib: UniffiLib) { lib.uniffi_matrix_sdk_ffi_fn_init_callback_sessionverificationcontrollerdelegate(this) } } internal val uniffiCallbackInterfaceSessionVerificationControllerDelegate = UniffiCallbackInterfaceSessionVerificationControllerDelegate() -// The ffiConverter which transforms the Callbacks in to Handles to pass to Rust. +// The ffiConverter which transforms the Callbacks in to UniffiHandles to pass to Rust. public object FfiConverterTypeSessionVerificationControllerDelegate: FfiConverterCallbackInterface() @@ -20663,7 +20645,7 @@ public interface SyncServiceStateObserver { // Implement the foreign callback handler for SyncServiceStateObserver internal class UniffiCallbackInterfaceSyncServiceStateObserver : ForeignCallback { @Suppress("TooGenericExceptionCaught") - override fun invoke(handle: Handle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { + override fun invoke(handle: UniffiHandle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { val cb = FfiConverterTypeSyncServiceStateObserver.handleMap.get(handle) return when (method) { IDX_CALLBACK_FREE -> { @@ -20724,14 +20706,14 @@ internal class UniffiCallbackInterfaceSyncServiceStateObserver : ForeignCallback // Registers the foreign callback with the Rust side. // This method is generated for each callback interface. - internal fun register(lib: _UniFFILib) { + internal fun register(lib: UniffiLib) { lib.uniffi_matrix_sdk_ffi_fn_init_callback_syncservicestateobserver(this) } } internal val uniffiCallbackInterfaceSyncServiceStateObserver = UniffiCallbackInterfaceSyncServiceStateObserver() -// The ffiConverter which transforms the Callbacks in to Handles to pass to Rust. +// The ffiConverter which transforms the Callbacks in to UniffiHandles to pass to Rust. public object FfiConverterTypeSyncServiceStateObserver: FfiConverterCallbackInterface() @@ -20749,7 +20731,7 @@ public interface TimelineListener { // Implement the foreign callback handler for TimelineListener internal class UniffiCallbackInterfaceTimelineListener : ForeignCallback { @Suppress("TooGenericExceptionCaught") - override fun invoke(handle: Handle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { + override fun invoke(handle: UniffiHandle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { val cb = FfiConverterTypeTimelineListener.handleMap.get(handle) return when (method) { IDX_CALLBACK_FREE -> { @@ -20810,14 +20792,14 @@ internal class UniffiCallbackInterfaceTimelineListener : ForeignCallback { // Registers the foreign callback with the Rust side. // This method is generated for each callback interface. - internal fun register(lib: _UniFFILib) { + internal fun register(lib: UniffiLib) { lib.uniffi_matrix_sdk_ffi_fn_init_callback_timelinelistener(this) } } internal val uniffiCallbackInterfaceTimelineListener = UniffiCallbackInterfaceTimelineListener() -// The ffiConverter which transforms the Callbacks in to Handles to pass to Rust. +// The ffiConverter which transforms the Callbacks in to UniffiHandles to pass to Rust. public object FfiConverterTypeTimelineListener: FfiConverterCallbackInterface() @@ -20835,7 +20817,7 @@ public interface WidgetCapabilitiesProvider { // Implement the foreign callback handler for WidgetCapabilitiesProvider internal class UniffiCallbackInterfaceWidgetCapabilitiesProvider : ForeignCallback { @Suppress("TooGenericExceptionCaught") - override fun invoke(handle: Handle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { + override fun invoke(handle: UniffiHandle, method: Int, argsData: Pointer, argsLen: Int, outBuf: RustBufferByReference): Int { val cb = FfiConverterTypeWidgetCapabilitiesProvider.handleMap.get(handle) return when (method) { IDX_CALLBACK_FREE -> { @@ -20898,14 +20880,14 @@ internal class UniffiCallbackInterfaceWidgetCapabilitiesProvider : ForeignCallba // Registers the foreign callback with the Rust side. // This method is generated for each callback interface. - internal fun register(lib: _UniFFILib) { + internal fun register(lib: UniffiLib) { lib.uniffi_matrix_sdk_ffi_fn_init_callback_widgetcapabilitiesprovider(this) } } internal val uniffiCallbackInterfaceWidgetCapabilitiesProvider = UniffiCallbackInterfaceWidgetCapabilitiesProvider() -// The ffiConverter which transforms the Callbacks in to Handles to pass to Rust. +// The ffiConverter which transforms the Callbacks in to UniffiHandles to pass to Rust. public object FfiConverterTypeWidgetCapabilitiesProvider: FfiConverterCallbackInterface() @@ -22941,8 +22923,8 @@ public object FfiConverterMapStringSequenceString: FfiConverterRustBuffer - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_gen_transaction_id(_status) + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_gen_transaction_id(_status) }) } @@ -22961,10 +22943,10 @@ fun `genTransactionId`(): String { @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") suspend fun `generateWebviewUrl`(`widgetSettings`: WidgetSettings, `room`: Room, `props`: ClientProperties) : String { return uniffiRustCallAsync( - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_generate_webview_url(FfiConverterTypeWidgetSettings.lower(`widgetSettings`),FfiConverterTypeRoom.lower(`room`),FfiConverterTypeClientProperties.lower(`props`),), - { future, callback, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> _UniFFILib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_generate_webview_url(FfiConverterTypeWidgetSettings.lower(`widgetSettings`),FfiConverterTypeRoom.lower(`room`),FfiConverterTypeClientProperties.lower(`props`),), + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, // lift function { FfiConverterString.lift(it) }, // Error FFI converter @@ -22988,8 +22970,8 @@ suspend fun `generateWebviewUrl`(`widgetSettings`: WidgetSettings, `room`: Room, fun `getElementCallRequiredPermissions`(): WidgetCapabilities { return FfiConverterTypeWidgetCapabilities.lift( - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_get_element_call_required_permissions(_status) + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_get_element_call_required_permissions(_status) }) } @@ -23010,8 +22992,8 @@ fun `getElementCallRequiredPermissions`(): WidgetCapabilities { fun `logEvent`(`file`: String, `line`: UInt?, `level`: LogLevel, `target`: String, `message`: String) = - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_log_event(FfiConverterString.lower(`file`),FfiConverterOptionalUInt.lower(`line`),FfiConverterTypeLogLevel.lower(`level`),FfiConverterString.lower(`target`),FfiConverterString.lower(`message`),_status) + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_log_event(FfiConverterString.lower(`file`),FfiConverterOptionalUInt.lower(`line`),FfiConverterTypeLogLevel.lower(`level`),FfiConverterString.lower(`target`),FfiConverterString.lower(`message`),_status) } @@ -23019,48 +23001,48 @@ fun `logEvent`(`file`: String, `line`: UInt?, `level`: LogLevel, `target`: Strin fun `makeWidgetDriver`(`settings`: WidgetSettings): WidgetDriverAndHandle { return FfiConverterTypeWidgetDriverAndHandle.lift( - rustCallWithError(ParseException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_make_widget_driver(FfiConverterTypeWidgetSettings.lower(`settings`),_status) + uniffiRustCallWithError(ParseException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_make_widget_driver(FfiConverterTypeWidgetSettings.lower(`settings`),_status) }) } fun `mediaSourceFromUrl`(`url`: String): MediaSource { return FfiConverterTypeMediaSource.lift( - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_media_source_from_url(FfiConverterString.lower(`url`),_status) + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_media_source_from_url(FfiConverterString.lower(`url`),_status) }) } fun `messageEventContentFromHtml`(`body`: String, `htmlBody`: String): RoomMessageEventContentWithoutRelation { return FfiConverterTypeRoomMessageEventContentWithoutRelation.lift( - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_message_event_content_from_html(FfiConverterString.lower(`body`),FfiConverterString.lower(`htmlBody`),_status) + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_message_event_content_from_html(FfiConverterString.lower(`body`),FfiConverterString.lower(`htmlBody`),_status) }) } fun `messageEventContentFromHtmlAsEmote`(`body`: String, `htmlBody`: String): RoomMessageEventContentWithoutRelation { return FfiConverterTypeRoomMessageEventContentWithoutRelation.lift( - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_message_event_content_from_html_as_emote(FfiConverterString.lower(`body`),FfiConverterString.lower(`htmlBody`),_status) + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_message_event_content_from_html_as_emote(FfiConverterString.lower(`body`),FfiConverterString.lower(`htmlBody`),_status) }) } fun `messageEventContentFromMarkdown`(`md`: String): RoomMessageEventContentWithoutRelation { return FfiConverterTypeRoomMessageEventContentWithoutRelation.lift( - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_message_event_content_from_markdown(FfiConverterString.lower(`md`),_status) + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_message_event_content_from_markdown(FfiConverterString.lower(`md`),_status) }) } fun `messageEventContentFromMarkdownAsEmote`(`md`: String): RoomMessageEventContentWithoutRelation { return FfiConverterTypeRoomMessageEventContentWithoutRelation.lift( - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_message_event_content_from_markdown_as_emote(FfiConverterString.lower(`md`),_status) + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_message_event_content_from_markdown_as_emote(FfiConverterString.lower(`md`),_status) }) } @@ -23068,8 +23050,8 @@ fun `messageEventContentFromMarkdownAsEmote`(`md`: String): RoomMessageEventCont fun `messageEventContentNew`(`msgtype`: MessageType): RoomMessageEventContentWithoutRelation { return FfiConverterTypeRoomMessageEventContentWithoutRelation.lift( - rustCallWithError(ClientException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_message_event_content_new(FfiConverterTypeMessageType.lower(`msgtype`),_status) + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_message_event_content_new(FfiConverterTypeMessageType.lower(`msgtype`),_status) }) } @@ -23090,32 +23072,32 @@ fun `messageEventContentNew`(`msgtype`: MessageType): RoomMessageEventContentWit fun `newVirtualElementCallWidget`(`props`: VirtualElementCallWidgetOptions): WidgetSettings { return FfiConverterTypeWidgetSettings.lift( - rustCallWithError(ParseException) { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_new_virtual_element_call_widget(FfiConverterTypeVirtualElementCallWidgetOptions.lower(`props`),_status) + uniffiRustCallWithError(ParseException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_new_virtual_element_call_widget(FfiConverterTypeVirtualElementCallWidgetOptions.lower(`props`),_status) }) } fun `sdkGitSha`(): String { return FfiConverterString.lift( - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_sdk_git_sha(_status) + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_sdk_git_sha(_status) }) } fun `setupOtlpTracing`(`config`: OtlpTracingConfiguration) = - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_setup_otlp_tracing(FfiConverterTypeOtlpTracingConfiguration.lower(`config`),_status) + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_setup_otlp_tracing(FfiConverterTypeOtlpTracingConfiguration.lower(`config`),_status) } fun `setupTracing`(`config`: TracingConfiguration) = - rustCall() { _status -> - _UniFFILib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_setup_tracing(FfiConverterTypeTracingConfiguration.lower(`config`),_status) + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_func_setup_tracing(FfiConverterTypeTracingConfiguration.lower(`config`),_status) } diff --git a/sdk/sdk-android/src/main/kotlin/uniffi/matrix_sdk_ui/matrix_sdk_ui.kt b/sdk/sdk-android/src/main/kotlin/uniffi/matrix_sdk_ui/matrix_sdk_ui.kt index 7f03684..44e52fb 100644 --- a/sdk/sdk-android/src/main/kotlin/uniffi/matrix_sdk_ui/matrix_sdk_ui.kt +++ b/sdk/sdk-android/src/main/kotlin/uniffi/matrix_sdk_ui/matrix_sdk_ui.kt @@ -44,8 +44,8 @@ open class RustBuffer : Structure() { class ByReference: RustBuffer(), Structure.ByReference companion object { - internal fun alloc(size: Int = 0) = rustCall() { status -> - _UniFFILib.INSTANCE.ffi_matrix_sdk_ui_rustbuffer_alloc(size, status) + internal fun alloc(size: Int = 0) = uniffiRustCall() { status -> + UniffiLib.INSTANCE.ffi_matrix_sdk_ui_rustbuffer_alloc(size, status) }.also { if(it.data == null) { throw RuntimeException("RustBuffer.alloc() returned null data pointer (size=${size})") @@ -60,8 +60,8 @@ open class RustBuffer : Structure() { return buf } - internal fun free(buf: RustBuffer.ByValue) = rustCall() { status -> - _UniFFILib.INSTANCE.ffi_matrix_sdk_ui_rustbuffer_free(buf, status) + internal fun free(buf: RustBuffer.ByValue) = uniffiRustCall() { status -> + UniffiLib.INSTANCE.ffi_matrix_sdk_ui_rustbuffer_free(buf, status) } } @@ -192,11 +192,11 @@ public interface FfiConverterRustBuffer: FfiConverter { +interface UniffiRustCallStatusErrorHandler { fun lift(error_buf: RustBuffer.ByValue): E; } @@ -223,15 +223,15 @@ interface CallStatusErrorHandler { // synchronize itself // Call a rust function that returns a Result<>. Pass in the Error class companion that corresponds to the Err -private inline fun rustCallWithError(errorHandler: CallStatusErrorHandler, callback: (RustCallStatus) -> U): U { - var status = RustCallStatus(); +private inline fun uniffiRustCallWithError(errorHandler: UniffiRustCallStatusErrorHandler, callback: (UniffiRustCallStatus) -> U): U { + var status = UniffiRustCallStatus(); val return_value = callback(status) - checkCallStatus(errorHandler, status) + uniffiCheckCallStatus(errorHandler, status) return return_value } -// Check RustCallStatus and throw an error if the call wasn't successful -private fun checkCallStatus(errorHandler: CallStatusErrorHandler, status: RustCallStatus) { +// Check UniffiRustCallStatus and throw an error if the call wasn't successful +private fun uniffiCheckCallStatus(errorHandler: UniffiRustCallStatusErrorHandler, status: UniffiRustCallStatus) { if (status.isSuccess()) { return } else if (status.isError()) { @@ -250,8 +250,8 @@ private fun checkCallStatus(errorHandler: CallStatusErrorHandler { +// UniffiRustCallStatusErrorHandler implementation for times when we don't expect a CALL_ERROR +object UniffiNullRustCallStatusErrorHandler: UniffiRustCallStatusErrorHandler { override fun lift(error_buf: RustBuffer.ByValue): InternalException { RustBuffer.free(error_buf) return InternalException("Unexpected CALL_ERROR") @@ -259,8 +259,8 @@ object NullCallStatusErrorHandler: CallStatusErrorHandler { } // Call a rust function that returns a plain value -private inline fun rustCall(callback: (RustCallStatus) -> U): U { - return rustCallWithError(NullCallStatusErrorHandler, callback); +private inline fun uniffiRustCall(callback: (UniffiRustCallStatus) -> U): U { + return uniffiRustCallWithError(UniffiNullRustCallStatusErrorHandler, callback); } // IntegerType that matches Rust's `usize` / C's `size_t` @@ -370,24 +370,25 @@ private inline fun loadIndirect( // A JNA Library to expose the extern-C FFI definitions. // This is an implementation detail which will be called internally by the public API. -internal interface _UniFFILib : Library { +internal interface UniffiLib : Library { companion object { - internal val INSTANCE: _UniFFILib by lazy { - loadIndirect<_UniFFILib>(componentName = "matrix_sdk_ui") - .also { lib: _UniFFILib -> + internal val INSTANCE: UniffiLib by lazy { + loadIndirect(componentName = "matrix_sdk_ui") + .also { lib: UniffiLib -> uniffiCheckContractApiVersion(lib) uniffiCheckApiChecksums(lib) } } + } - fun ffi_matrix_sdk_ui_rustbuffer_alloc(`size`: Int,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ui_rustbuffer_alloc(`size`: Int,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun ffi_matrix_sdk_ui_rustbuffer_from_bytes(`bytes`: ForeignBytes.ByValue,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ui_rustbuffer_from_bytes(`bytes`: ForeignBytes.ByValue,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue - fun ffi_matrix_sdk_ui_rustbuffer_free(`buf`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ui_rustbuffer_free(`buf`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Unit - fun ffi_matrix_sdk_ui_rustbuffer_reserve(`buf`: RustBuffer.ByValue,`additional`: Int,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ui_rustbuffer_reserve(`buf`: RustBuffer.ByValue,`additional`: Int,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun ffi_matrix_sdk_ui_rust_future_poll_u8(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -395,7 +396,7 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ui_rust_future_free_u8(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ui_rust_future_complete_u8(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ui_rust_future_complete_u8(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte fun ffi_matrix_sdk_ui_rust_future_poll_i8(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -403,7 +404,7 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ui_rust_future_free_i8(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ui_rust_future_complete_i8(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ui_rust_future_complete_i8(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte fun ffi_matrix_sdk_ui_rust_future_poll_u16(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -411,7 +412,7 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ui_rust_future_free_u16(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ui_rust_future_complete_u16(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ui_rust_future_complete_u16(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Short fun ffi_matrix_sdk_ui_rust_future_poll_i16(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -419,7 +420,7 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ui_rust_future_free_i16(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ui_rust_future_complete_i16(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ui_rust_future_complete_i16(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Short fun ffi_matrix_sdk_ui_rust_future_poll_u32(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -427,7 +428,7 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ui_rust_future_free_u32(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ui_rust_future_complete_u32(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ui_rust_future_complete_u32(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Int fun ffi_matrix_sdk_ui_rust_future_poll_i32(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -435,7 +436,7 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ui_rust_future_free_i32(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ui_rust_future_complete_i32(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ui_rust_future_complete_i32(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Int fun ffi_matrix_sdk_ui_rust_future_poll_u64(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -443,7 +444,7 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ui_rust_future_free_u64(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ui_rust_future_complete_u64(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ui_rust_future_complete_u64(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Long fun ffi_matrix_sdk_ui_rust_future_poll_i64(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -451,7 +452,7 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ui_rust_future_free_i64(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ui_rust_future_complete_i64(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ui_rust_future_complete_i64(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Long fun ffi_matrix_sdk_ui_rust_future_poll_f32(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -459,7 +460,7 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ui_rust_future_free_f32(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ui_rust_future_complete_f32(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ui_rust_future_complete_f32(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Float fun ffi_matrix_sdk_ui_rust_future_poll_f64(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -467,7 +468,7 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ui_rust_future_free_f64(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ui_rust_future_complete_f64(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ui_rust_future_complete_f64(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Double fun ffi_matrix_sdk_ui_rust_future_poll_pointer(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -475,7 +476,7 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ui_rust_future_free_pointer(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ui_rust_future_complete_pointer(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ui_rust_future_complete_pointer(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun ffi_matrix_sdk_ui_rust_future_poll_rust_buffer(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -483,7 +484,7 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ui_rust_future_free_rust_buffer(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ui_rust_future_complete_rust_buffer(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ui_rust_future_complete_rust_buffer(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun ffi_matrix_sdk_ui_rust_future_poll_void(`handle`: Pointer,`callback`: UniFffiRustFutureContinuationCallbackType,`callbackData`: USize, ): Unit @@ -491,14 +492,14 @@ internal interface _UniFFILib : Library { ): Unit fun ffi_matrix_sdk_ui_rust_future_free_void(`handle`: Pointer, ): Unit - fun ffi_matrix_sdk_ui_rust_future_complete_void(`handle`: Pointer,_uniffi_out_err: RustCallStatus, + fun ffi_matrix_sdk_ui_rust_future_complete_void(`handle`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit fun ffi_matrix_sdk_ui_uniffi_contract_version( ): Int } -private fun uniffiCheckContractApiVersion(lib: _UniFFILib) { +private fun uniffiCheckContractApiVersion(lib: UniffiLib) { // Get the bindings contract version from our ComponentInterface val bindings_contract_version = 25 // Get the scaffolding contract version by calling the into the dylib @@ -509,7 +510,7 @@ private fun uniffiCheckContractApiVersion(lib: _UniFFILib) { } @Suppress("UNUSED_PARAMETER") -private fun uniffiCheckApiChecksums(lib: _UniFFILib) { +private fun uniffiCheckApiChecksums(lib: UniffiLib) { } // Async support