Skip to content

Commit 3e35994

Browse files
committed
Bump to v1.1.27 (matrix-rust-sdk/main d8c02d7e55bbba78d2725a29bdcd62f0dd179e08)
1 parent d8588b9 commit 3e35994

File tree

2 files changed

+107
-31
lines changed

2 files changed

+107
-31
lines changed

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
import PackageDescription
55

6-
let checksum = "6f75dc480063cf0cab70d47d307cb73358865552497488e5c6c55a1b95269dee"
7-
let version = "v0.0.7-november23"
6+
let checksum = "9ab313694b9196f71ee07c6b72f9f4ea1391f408cad725de0445c031dc94b2b1"
7+
let version = "v1.1.27"
88
let url = "https://github.com/matrix-org/matrix-rust-components-swift/releases/download/\(version)/MatrixSDKFFI.xcframework.zip"
99

1010
let package = Package(

Sources/MatrixRustSDK/matrix_sdk_ffi.swift

Lines changed: 105 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,7 +1439,7 @@ public class Encryption:
14391439
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_void,
14401440
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_void,
14411441
liftFunc: { $0 },
1442-
errorHandler: FfiConverterTypeClientError.lift
1442+
errorHandler: FfiConverterTypeRecoveryError.lift
14431443
)
14441444
}
14451445

@@ -1456,7 +1456,7 @@ public class Encryption:
14561456
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_void,
14571457
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_void,
14581458
liftFunc: { $0 },
1459-
errorHandler: FfiConverterTypeClientError.lift
1459+
errorHandler: FfiConverterTypeRecoveryError.lift
14601460
)
14611461
}
14621462

@@ -1475,7 +1475,7 @@ public class Encryption:
14751475
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer,
14761476
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_rust_buffer,
14771477
liftFunc: FfiConverterString.lift,
1478-
errorHandler: FfiConverterTypeClientError.lift
1478+
errorHandler: FfiConverterTypeRecoveryError.lift
14791479
)
14801480
}
14811481

@@ -1492,7 +1492,7 @@ public class Encryption:
14921492
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_i8,
14931493
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_i8,
14941494
liftFunc: FfiConverterBool.lift,
1495-
errorHandler: FfiConverterTypeClientError.lift
1495+
errorHandler: FfiConverterTypeRecoveryError.lift
14961496
)
14971497
}
14981498

@@ -1510,7 +1510,7 @@ public class Encryption:
15101510
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_void,
15111511
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_void,
15121512
liftFunc: { $0 },
1513-
errorHandler: FfiConverterTypeClientError.lift
1513+
errorHandler: FfiConverterTypeRecoveryError.lift
15141514
)
15151515
}
15161516

@@ -1528,7 +1528,7 @@ public class Encryption:
15281528
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer,
15291529
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_rust_buffer,
15301530
liftFunc: FfiConverterString.lift,
1531-
errorHandler: FfiConverterTypeClientError.lift
1531+
errorHandler: FfiConverterTypeRecoveryError.lift
15321532
)
15331533
}
15341534

@@ -1568,7 +1568,7 @@ public class Encryption:
15681568
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer,
15691569
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_rust_buffer,
15701570
liftFunc: FfiConverterString.lift,
1571-
errorHandler: FfiConverterTypeClientError.lift
1571+
errorHandler: FfiConverterTypeRecoveryError.lift
15721572
)
15731573
}
15741574

@@ -12764,6 +12764,71 @@ extension PusherKind: Equatable, Hashable {}
1276412764

1276512765

1276612766

12767+
public enum RecoveryError {
12768+
12769+
12770+
12771+
case BackupExistsOnServer
12772+
case Client(source: ClientError)
12773+
case SecretStorage(message: String)
12774+
12775+
fileprivate static func uniffiErrorHandler(_ error: RustBuffer) throws -> Error {
12776+
return try FfiConverterTypeRecoveryError.lift(error)
12777+
}
12778+
}
12779+
12780+
12781+
public struct FfiConverterTypeRecoveryError: FfiConverterRustBuffer {
12782+
typealias SwiftType = RecoveryError
12783+
12784+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> RecoveryError {
12785+
let variant: Int32 = try readInt(&buf)
12786+
switch variant {
12787+
12788+
12789+
12790+
12791+
case 1: return .BackupExistsOnServer
12792+
case 2: return .Client(
12793+
source: try FfiConverterTypeClientError.read(from: &buf)
12794+
)
12795+
case 3: return .SecretStorage(
12796+
message: try FfiConverterString.read(from: &buf)
12797+
)
12798+
12799+
default: throw UniffiInternalError.unexpectedEnumCase
12800+
}
12801+
}
12802+
12803+
public static func write(_ value: RecoveryError, into buf: inout [UInt8]) {
12804+
switch value {
12805+
12806+
12807+
12808+
12809+
12810+
case .BackupExistsOnServer:
12811+
writeInt(&buf, Int32(1))
12812+
12813+
12814+
case let .Client(source):
12815+
writeInt(&buf, Int32(2))
12816+
FfiConverterTypeClientError.write(source, into: &buf)
12817+
12818+
12819+
case let .SecretStorage(message):
12820+
writeInt(&buf, Int32(3))
12821+
FfiConverterString.write(message, into: &buf)
12822+
12823+
}
12824+
}
12825+
}
12826+
12827+
12828+
extension RecoveryError: Equatable, Hashable {}
12829+
12830+
extension RecoveryError: Error { }
12831+
1276712832
// Note that we don't yet support `indirect` for enums.
1276812833
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
1276912834
public enum RecoveryState {
@@ -14155,9 +14220,15 @@ public enum SteadyStateError {
1415514220

1415614221

1415714222

14158-
case BackupDisabled
14159-
case Connection
14160-
case Lagged
14223+
// Simple error enums only carry a message
14224+
case BackupDisabled(message: String)
14225+
14226+
// Simple error enums only carry a message
14227+
case Connection(message: String)
14228+
14229+
// Simple error enums only carry a message
14230+
case Lagged(message: String)
14231+
1416114232

1416214233
fileprivate static func uniffiErrorHandler(_ error: RustBuffer) throws -> Error {
1416314234
return try FfiConverterTypeSteadyStateError.lift(error)
@@ -14175,11 +14246,20 @@ public struct FfiConverterTypeSteadyStateError: FfiConverterRustBuffer {
1417514246

1417614247

1417714248

14178-
case 1: return .BackupDisabled
14179-
case 2: return .Connection
14180-
case 3: return .Lagged
14249+
case 1: return .BackupDisabled(
14250+
message: try FfiConverterString.read(from: &buf)
14251+
)
14252+
14253+
case 2: return .Connection(
14254+
message: try FfiConverterString.read(from: &buf)
14255+
)
14256+
14257+
case 3: return .Lagged(
14258+
message: try FfiConverterString.read(from: &buf)
14259+
)
14260+
1418114261

14182-
default: throw UniffiInternalError.unexpectedEnumCase
14262+
default: throw UniffiInternalError.unexpectedEnumCase
1418314263
}
1418414264
}
1418514265

@@ -14189,17 +14269,13 @@ public struct FfiConverterTypeSteadyStateError: FfiConverterRustBuffer {
1418914269

1419014270

1419114271

14192-
14193-
case .BackupDisabled:
14272+
case .BackupDisabled(_ /* message is ignored*/):
1419414273
writeInt(&buf, Int32(1))
14195-
14196-
14197-
case .Connection:
14274+
case .Connection(_ /* message is ignored*/):
1419814275
writeInt(&buf, Int32(2))
14199-
14200-
14201-
case .Lagged:
14276+
case .Lagged(_ /* message is ignored*/):
1420214277
writeInt(&buf, Int32(3))
14278+
1420314279

1420414280
}
1420514281
}
@@ -18525,22 +18601,22 @@ private var initializationResult: InitializationResult {
1852518601
if (uniffi_matrix_sdk_ffi_checksum_method_encryption_backup_state_listener() != 29) {
1852618602
return InitializationResult.apiChecksumMismatch
1852718603
}
18528-
if (uniffi_matrix_sdk_ffi_checksum_method_encryption_disable_recovery() != 56498) {
18604+
if (uniffi_matrix_sdk_ffi_checksum_method_encryption_disable_recovery() != 38729) {
1852918605
return InitializationResult.apiChecksumMismatch
1853018606
}
18531-
if (uniffi_matrix_sdk_ffi_checksum_method_encryption_enable_backups() != 38094) {
18607+
if (uniffi_matrix_sdk_ffi_checksum_method_encryption_enable_backups() != 30690) {
1853218608
return InitializationResult.apiChecksumMismatch
1853318609
}
18534-
if (uniffi_matrix_sdk_ffi_checksum_method_encryption_enable_recovery() != 13489) {
18610+
if (uniffi_matrix_sdk_ffi_checksum_method_encryption_enable_recovery() != 60849) {
1853518611
return InitializationResult.apiChecksumMismatch
1853618612
}
18537-
if (uniffi_matrix_sdk_ffi_checksum_method_encryption_is_last_device() != 30199) {
18613+
if (uniffi_matrix_sdk_ffi_checksum_method_encryption_is_last_device() != 34446) {
1853818614
return InitializationResult.apiChecksumMismatch
1853918615
}
18540-
if (uniffi_matrix_sdk_ffi_checksum_method_encryption_recover() != 29174) {
18616+
if (uniffi_matrix_sdk_ffi_checksum_method_encryption_recover() != 34668) {
1854118617
return InitializationResult.apiChecksumMismatch
1854218618
}
18543-
if (uniffi_matrix_sdk_ffi_checksum_method_encryption_recover_and_reset() != 16535) {
18619+
if (uniffi_matrix_sdk_ffi_checksum_method_encryption_recover_and_reset() != 52410) {
1854418620
return InitializationResult.apiChecksumMismatch
1854518621
}
1854618622
if (uniffi_matrix_sdk_ffi_checksum_method_encryption_recovery_state() != 7187) {
@@ -18549,7 +18625,7 @@ private var initializationResult: InitializationResult {
1854918625
if (uniffi_matrix_sdk_ffi_checksum_method_encryption_recovery_state_listener() != 11439) {
1855018626
return InitializationResult.apiChecksumMismatch
1855118627
}
18552-
if (uniffi_matrix_sdk_ffi_checksum_method_encryption_reset_recovery_key() != 55362) {
18628+
if (uniffi_matrix_sdk_ffi_checksum_method_encryption_reset_recovery_key() != 40510) {
1855318629
return InitializationResult.apiChecksumMismatch
1855418630
}
1855518631
if (uniffi_matrix_sdk_ffi_checksum_method_encryption_wait_for_backup_upload_steady_state() != 37083) {

0 commit comments

Comments
 (0)