@@ -570,26 +570,26 @@ public protocol AuthenticationServiceProtocol : AnyObject {
570570     * Updates the service to authenticate with the homeserver for the
571571     * specified address.
572572     */
573-     func configureHomeserver(serverNameOrHomeserverUrl: String) throws 
573+     func configureHomeserver(serverNameOrHomeserverUrl: String) async  throws 
574574
575575    func homeserverDetails()  -> HomeserverLoginDetails?
576576
577577    /**
578578     * Performs a password login using the current homeserver.
579579     */
580-     func login(username: String, password: String, initialDeviceName: String?, deviceId: String?) throws  -> Client
580+     func login(username: String, password: String, initialDeviceName: String?, deviceId: String?) async  throws  -> Client
581581
582582    /**
583583     * Completes the OIDC login process.
584584     */
585-     func loginWithOidcCallback(authenticationData: OidcAuthenticationData, callbackUrl: String) throws  -> Client
585+     func loginWithOidcCallback(authenticationData: OidcAuthenticationData, callbackUrl: String) async  throws  -> Client
586586
587587    /**
588588     * Requests the URL needed for login in a web view using OIDC. Once the web
589589     * view has succeeded, call `login_with_oidc_callback` with the callback it
590590     * returns.
591591     */
592-     func urlForOidcLogin() throws  -> OidcAuthenticationData
592+     func urlForOidcLogin() async  throws  -> OidcAuthenticationData
593593
594594}
595595
@@ -655,14 +655,23 @@ open class AuthenticationService:
655655     * Updates the service to authenticate with the homeserver for the
656656     * specified address.
657657     */
658-     open func configureHomeserver(serverNameOrHomeserverUrl: String) throws  {
659-         try 
660-     rustCallWithError(FfiConverterTypeAuthenticationError.lift) {
661-     uniffi_matrix_sdk_ffi_fn_method_authenticationservice_configure_homeserver(self.uniffiClonePointer(), 
662-         FfiConverterString.lower(serverNameOrHomeserverUrl),$0
663-     )
664- }
658+     open func configureHomeserver(serverNameOrHomeserverUrl: String) async throws  {
659+         return try  await uniffiRustCallAsync(
660+             rustFutureFunc: {
661+                 uniffi_matrix_sdk_ffi_fn_method_authenticationservice_configure_homeserver(
662+                     self.uniffiClonePointer(),
663+                     FfiConverterString.lower(serverNameOrHomeserverUrl)
664+                 )
665+             },
666+             pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_void,
667+             completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_void,
668+             freeFunc: ffi_matrix_sdk_ffi_rust_future_free_void,
669+             liftFunc: { $0 },
670+             errorHandler: FfiConverterTypeAuthenticationError.lift
671+         )
665672    }
673+ 
674+     
666675    open func homeserverDetails()  -> HomeserverLoginDetails? {
667676        return try!  FfiConverterOptionTypeHomeserverLoginDetails.lift(
668677            try! 
@@ -676,48 +685,69 @@ open class AuthenticationService:
676685    /**
677686     * Performs a password login using the current homeserver.
678687     */
679-     open func login(username: String, password: String, initialDeviceName: String?, deviceId: String?) throws  -> Client {
680-         return try  FfiConverterTypeClient.lift(
681-             try 
682-     rustCallWithError(FfiConverterTypeAuthenticationError.lift) {
683-     uniffi_matrix_sdk_ffi_fn_method_authenticationservice_login(self.uniffiClonePointer(), 
684-         FfiConverterString.lower(username),
685-         FfiConverterString.lower(password),
686-         FfiConverterOptionString.lower(initialDeviceName),
687-         FfiConverterOptionString.lower(deviceId),$0
688-     )
689- }
688+     open func login(username: String, password: String, initialDeviceName: String?, deviceId: String?) async throws  -> Client {
689+         return try  await uniffiRustCallAsync(
690+             rustFutureFunc: {
691+                 uniffi_matrix_sdk_ffi_fn_method_authenticationservice_login(
692+                     self.uniffiClonePointer(),
693+                     FfiConverterString.lower(username),
694+                     FfiConverterString.lower(password),
695+                     FfiConverterOptionString.lower(initialDeviceName),
696+                     FfiConverterOptionString.lower(deviceId)
697+                 )
698+             },
699+             pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_pointer,
700+             completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_pointer,
701+             freeFunc: ffi_matrix_sdk_ffi_rust_future_free_pointer,
702+             liftFunc: FfiConverterTypeClient.lift,
703+             errorHandler: FfiConverterTypeAuthenticationError.lift
690704        )
691705    }
706+ 
707+     
692708    /**
693709     * Completes the OIDC login process.
694710     */
695-     open func loginWithOidcCallback(authenticationData: OidcAuthenticationData, callbackUrl: String) throws  -> Client {
696-         return try  FfiConverterTypeClient.lift(
697-             try 
698-     rustCallWithError(FfiConverterTypeAuthenticationError.lift) {
699-     uniffi_matrix_sdk_ffi_fn_method_authenticationservice_login_with_oidc_callback(self.uniffiClonePointer(), 
700-         FfiConverterTypeOidcAuthenticationData.lower(authenticationData),
701-         FfiConverterString.lower(callbackUrl),$0
702-     )
703- }
711+     open func loginWithOidcCallback(authenticationData: OidcAuthenticationData, callbackUrl: String) async throws  -> Client {
712+         return try  await uniffiRustCallAsync(
713+             rustFutureFunc: {
714+                 uniffi_matrix_sdk_ffi_fn_method_authenticationservice_login_with_oidc_callback(
715+                     self.uniffiClonePointer(),
716+                     FfiConverterTypeOidcAuthenticationData.lower(authenticationData),
717+                     FfiConverterString.lower(callbackUrl)
718+                 )
719+             },
720+             pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_pointer,
721+             completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_pointer,
722+             freeFunc: ffi_matrix_sdk_ffi_rust_future_free_pointer,
723+             liftFunc: FfiConverterTypeClient.lift,
724+             errorHandler: FfiConverterTypeAuthenticationError.lift
704725        )
705726    }
727+ 
728+     
706729    /**
707730     * Requests the URL needed for login in a web view using OIDC. Once the web
708731     * view has succeeded, call `login_with_oidc_callback` with the callback it
709732     * returns.
710733     */
711-     open func urlForOidcLogin() throws  -> OidcAuthenticationData {
712-         return try  FfiConverterTypeOidcAuthenticationData.lift(
713-             try 
714-     rustCallWithError(FfiConverterTypeAuthenticationError.lift) {
715-     uniffi_matrix_sdk_ffi_fn_method_authenticationservice_url_for_oidc_login(self.uniffiClonePointer(), $0
716-     )
717- }
734+     open func urlForOidcLogin() async throws  -> OidcAuthenticationData {
735+         return try  await uniffiRustCallAsync(
736+             rustFutureFunc: {
737+                 uniffi_matrix_sdk_ffi_fn_method_authenticationservice_url_for_oidc_login(
738+                     self.uniffiClonePointer()
739+                 )
740+             },
741+             pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_pointer,
742+             completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_pointer,
743+             freeFunc: ffi_matrix_sdk_ffi_rust_future_free_pointer,
744+             liftFunc: FfiConverterTypeOidcAuthenticationData.lift,
745+             errorHandler: FfiConverterTypeAuthenticationError.lift
718746        )
719747    }
720748
749+     
750+ 
721751}
722752
723753public struct FfiConverterTypeAuthenticationService: FfiConverter {
@@ -824,7 +854,7 @@ public protocol ClientProtocol : AnyObject {
824854    /**
825855     * Login using a username and password.
826856     */
827-     func login(username: String, password: String, initialDeviceName: String?, deviceId: String?) throws 
857+     func login(username: String, password: String, initialDeviceName: String?, deviceId: String?) async  throws 
828858
829859    /**
830860     * Log out the current user. This method returns an optional URL that
@@ -1203,17 +1233,26 @@ open class Client:
12031233    /**
12041234     * Login using a username and password.
12051235     */
1206-     open func login(username: String, password: String, initialDeviceName: String?, deviceId: String?) throws  {
1207-         try 
1208-     rustCallWithError(FfiConverterTypeClientError.lift) {
1209-     uniffi_matrix_sdk_ffi_fn_method_client_login(self.uniffiClonePointer(), 
1210-         FfiConverterString.lower(username),
1211-         FfiConverterString.lower(password),
1212-         FfiConverterOptionString.lower(initialDeviceName),
1213-         FfiConverterOptionString.lower(deviceId),$0
1214-     )
1215- }
1236+     open func login(username: String, password: String, initialDeviceName: String?, deviceId: String?) async throws  {
1237+         return try  await uniffiRustCallAsync(
1238+             rustFutureFunc: {
1239+                 uniffi_matrix_sdk_ffi_fn_method_client_login(
1240+                     self.uniffiClonePointer(),
1241+                     FfiConverterString.lower(username),
1242+                     FfiConverterString.lower(password),
1243+                     FfiConverterOptionString.lower(initialDeviceName),
1244+                     FfiConverterOptionString.lower(deviceId)
1245+                 )
1246+             },
1247+             pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_void,
1248+             completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_void,
1249+             freeFunc: ffi_matrix_sdk_ffi_rust_future_free_void,
1250+             liftFunc: { $0 },
1251+             errorHandler: FfiConverterTypeClientError.lift
1252+         )
12161253    }
1254+ 
1255+     
12171256    /**
12181257     * Log out the current user. This method returns an optional URL that
12191258     * should be presented to the user to complete logout (in the case of
@@ -1500,7 +1539,7 @@ public protocol ClientBuilderProtocol : AnyObject {
15001539
15011540    func basePath(path: String)  -> ClientBuilder
15021541
1503-     func build() throws  -> Client
1542+     func build() async  throws  -> Client
15041543
15051544    func disableAutomaticTokenRefresh()  -> ClientBuilder
15061545
@@ -1598,15 +1637,22 @@ open class ClientBuilder:
15981637}
15991638        )
16001639    }
1601-     open func build() throws  -> Client {
1602-         return try  FfiConverterTypeClient.lift(
1603-             try 
1604-     rustCallWithError(FfiConverterTypeClientBuildError.lift) {
1605-     uniffi_matrix_sdk_ffi_fn_method_clientbuilder_build(self.uniffiClonePointer(), $0
1606-     )
1607- }
1640+     open func build() async throws  -> Client {
1641+         return try  await uniffiRustCallAsync(
1642+             rustFutureFunc: {
1643+                 uniffi_matrix_sdk_ffi_fn_method_clientbuilder_build(
1644+                     self.uniffiClonePointer()
1645+                 )
1646+             },
1647+             pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_pointer,
1648+             completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_pointer,
1649+             freeFunc: ffi_matrix_sdk_ffi_rust_future_free_pointer,
1650+             liftFunc: FfiConverterTypeClient.lift,
1651+             errorHandler: FfiConverterTypeClientBuildError.lift
16081652        )
16091653    }
1654+ 
1655+     
16101656    open func disableAutomaticTokenRefresh()  -> ClientBuilder {
16111657        return try!  FfiConverterTypeClientBuilder.lift(
16121658            try! 
@@ -23127,19 +23173,19 @@ private var initializationResult: InitializationResult {
2312723173    if (uniffi_matrix_sdk_ffi_checksum_method_roommessageeventcontentwithoutrelation_with_mentions() != 8867) {
2312823174        return InitializationResult.apiChecksumMismatch
2312923175    }
23130-     if (uniffi_matrix_sdk_ffi_checksum_method_authenticationservice_configure_homeserver() != 39888 ) {
23176+     if (uniffi_matrix_sdk_ffi_checksum_method_authenticationservice_configure_homeserver() != 13406 ) {
2313123177        return InitializationResult.apiChecksumMismatch
2313223178    }
2313323179    if (uniffi_matrix_sdk_ffi_checksum_method_authenticationservice_homeserver_details() != 39542) {
2313423180        return InitializationResult.apiChecksumMismatch
2313523181    }
23136-     if (uniffi_matrix_sdk_ffi_checksum_method_authenticationservice_login() != 50794 ) {
23182+     if (uniffi_matrix_sdk_ffi_checksum_method_authenticationservice_login() != 30740 ) {
2313723183        return InitializationResult.apiChecksumMismatch
2313823184    }
23139-     if (uniffi_matrix_sdk_ffi_checksum_method_authenticationservice_login_with_oidc_callback() != 32717 ) {
23185+     if (uniffi_matrix_sdk_ffi_checksum_method_authenticationservice_login_with_oidc_callback() != 52385 ) {
2314023186        return InitializationResult.apiChecksumMismatch
2314123187    }
23142-     if (uniffi_matrix_sdk_ffi_checksum_method_authenticationservice_url_for_oidc_login() != 47926 ) {
23188+     if (uniffi_matrix_sdk_ffi_checksum_method_authenticationservice_url_for_oidc_login() != 64804 ) {
2314323189        return InitializationResult.apiChecksumMismatch
2314423190    }
2314523191    if (uniffi_matrix_sdk_ffi_checksum_method_client_account_data() != 42952) {
@@ -23205,7 +23251,7 @@ private var initializationResult: InitializationResult {
2320523251    if (uniffi_matrix_sdk_ffi_checksum_method_client_join_room_by_id() != 61264) {
2320623252        return InitializationResult.apiChecksumMismatch
2320723253    }
23208-     if (uniffi_matrix_sdk_ffi_checksum_method_client_login() != 55564 ) {
23254+     if (uniffi_matrix_sdk_ffi_checksum_method_client_login() != 32848 ) {
2320923255        return InitializationResult.apiChecksumMismatch
2321023256    }
2321123257    if (uniffi_matrix_sdk_ffi_checksum_method_client_logout() != 7127) {
@@ -23271,7 +23317,7 @@ private var initializationResult: InitializationResult {
2327123317    if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_base_path() != 40888) {
2327223318        return InitializationResult.apiChecksumMismatch
2327323319    }
23274-     if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_build() != 22728 ) {
23320+     if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_build() != 56018 ) {
2327523321        return InitializationResult.apiChecksumMismatch
2327623322    }
2327723323    if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_disable_automatic_token_refresh() != 43839) {
0 commit comments