Skip to content

Commit 535c89c

Browse files
committed
Bump to version v1.0.5 (matrix-rust-sdk/main 59d1f34)
1 parent 1005986 commit 535c89c

File tree

3 files changed

+640
-2
lines changed

3 files changed

+640
-2
lines changed

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// swift-tools-version:5.9
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33
import PackageDescription
4-
let checksum = "dffb8c8b5e6d068db970dd49c24c0f7f735d1d129df113b81e9b35338cea5fca"
5-
let version = "v1.0.4"
4+
let checksum = "46e2bea4a7016a5f8c36522c063640673f7caa3c9db683e47987d80beb5c8627"
5+
let version = "v1.0.5"
66
let url = "https://github.com/element-hq/matrix-rust-components-swift/releases/download/\(version)/MatrixSDKFFI.xcframework.zip"
77
let package = Package(
88
name: "MatrixRustSDK",

Sources/MatrixRustSDK/matrix_sdk.swift

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,144 @@ extension PaginatorState: Equatable, Hashable {}
789789

790790

791791

792+
// Note that we don't yet support `indirect` for enums.
793+
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
794+
/**
795+
* The error type for failures while trying to log in a new device using a QR
796+
* code.
797+
*/
798+
799+
public enum QrCodeLoginError {
800+
801+
/**
802+
* An error happened while we were communicating with the OIDC provider.
803+
*/
804+
case oidc
805+
/**
806+
* The other device has signaled to us that the login has failed.
807+
*/
808+
case loginFailure
809+
/**
810+
* An unexpected message was received from the other device.
811+
*/
812+
case unexpectedMessage
813+
/**
814+
* An error happened while exchanging messages with the other device.
815+
*/
816+
case secureChannel
817+
/**
818+
* The cross-process refresh lock failed to be initialized.
819+
*/
820+
case crossProcessRefreshLock
821+
/**
822+
* An error happened while we were trying to discover our user and device
823+
* ID, after we have acquired an access token from the OIDC provider.
824+
*/
825+
case userIdDiscovery
826+
/**
827+
* We failed to set the session tokens after we figured out our device and
828+
* user IDs.
829+
*/
830+
case sessionTokens
831+
/**
832+
* The device keys failed to be uploaded after we successfully logged in.
833+
*/
834+
case deviceKeyUpload
835+
/**
836+
* The secrets bundle we received from the existing device failed to be
837+
* imported.
838+
*/
839+
case secretImport
840+
}
841+
842+
843+
public struct FfiConverterTypeQRCodeLoginError: FfiConverterRustBuffer {
844+
typealias SwiftType = QrCodeLoginError
845+
846+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> QrCodeLoginError {
847+
let variant: Int32 = try readInt(&buf)
848+
switch variant {
849+
850+
case 1: return .oidc
851+
852+
case 2: return .loginFailure
853+
854+
case 3: return .unexpectedMessage
855+
856+
case 4: return .secureChannel
857+
858+
case 5: return .crossProcessRefreshLock
859+
860+
case 6: return .userIdDiscovery
861+
862+
case 7: return .sessionTokens
863+
864+
case 8: return .deviceKeyUpload
865+
866+
case 9: return .secretImport
867+
868+
default: throw UniffiInternalError.unexpectedEnumCase
869+
}
870+
}
871+
872+
public static func write(_ value: QrCodeLoginError, into buf: inout [UInt8]) {
873+
switch value {
874+
875+
876+
case .oidc:
877+
writeInt(&buf, Int32(1))
878+
879+
880+
case .loginFailure:
881+
writeInt(&buf, Int32(2))
882+
883+
884+
case .unexpectedMessage:
885+
writeInt(&buf, Int32(3))
886+
887+
888+
case .secureChannel:
889+
writeInt(&buf, Int32(4))
890+
891+
892+
case .crossProcessRefreshLock:
893+
writeInt(&buf, Int32(5))
894+
895+
896+
case .userIdDiscovery:
897+
writeInt(&buf, Int32(6))
898+
899+
900+
case .sessionTokens:
901+
writeInt(&buf, Int32(7))
902+
903+
904+
case .deviceKeyUpload:
905+
writeInt(&buf, Int32(8))
906+
907+
908+
case .secretImport:
909+
writeInt(&buf, Int32(9))
910+
911+
}
912+
}
913+
}
914+
915+
916+
public func FfiConverterTypeQRCodeLoginError_lift(_ buf: RustBuffer) throws -> QrCodeLoginError {
917+
return try FfiConverterTypeQRCodeLoginError.lift(buf)
918+
}
919+
920+
public func FfiConverterTypeQRCodeLoginError_lower(_ value: QrCodeLoginError) -> RustBuffer {
921+
return FfiConverterTypeQRCodeLoginError.lower(value)
922+
}
923+
924+
925+
926+
extension QrCodeLoginError: Equatable, Hashable {}
927+
928+
929+
792930
// Note that we don't yet support `indirect` for enums.
793931
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
794932
/**

0 commit comments

Comments
 (0)