@@ -1439,7 +1439,7 @@ public class Encryption:
1439
1439
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_void,
1440
1440
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_void,
1441
1441
liftFunc: { $0 },
1442
- errorHandler: FfiConverterTypeClientError .lift
1442
+ errorHandler: FfiConverterTypeRecoveryError .lift
1443
1443
)
1444
1444
}
1445
1445
@@ -1456,7 +1456,7 @@ public class Encryption:
1456
1456
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_void,
1457
1457
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_void,
1458
1458
liftFunc: { $0 },
1459
- errorHandler: FfiConverterTypeClientError .lift
1459
+ errorHandler: FfiConverterTypeRecoveryError .lift
1460
1460
)
1461
1461
}
1462
1462
@@ -1475,7 +1475,7 @@ public class Encryption:
1475
1475
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer,
1476
1476
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_rust_buffer,
1477
1477
liftFunc: FfiConverterString.lift,
1478
- errorHandler: FfiConverterTypeClientError .lift
1478
+ errorHandler: FfiConverterTypeRecoveryError .lift
1479
1479
)
1480
1480
}
1481
1481
@@ -1492,7 +1492,7 @@ public class Encryption:
1492
1492
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_i8,
1493
1493
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_i8,
1494
1494
liftFunc: FfiConverterBool.lift,
1495
- errorHandler: FfiConverterTypeClientError .lift
1495
+ errorHandler: FfiConverterTypeRecoveryError .lift
1496
1496
)
1497
1497
}
1498
1498
@@ -1510,7 +1510,7 @@ public class Encryption:
1510
1510
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_void,
1511
1511
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_void,
1512
1512
liftFunc: { $0 },
1513
- errorHandler: FfiConverterTypeClientError .lift
1513
+ errorHandler: FfiConverterTypeRecoveryError .lift
1514
1514
)
1515
1515
}
1516
1516
@@ -1528,7 +1528,7 @@ public class Encryption:
1528
1528
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer,
1529
1529
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_rust_buffer,
1530
1530
liftFunc: FfiConverterString.lift,
1531
- errorHandler: FfiConverterTypeClientError .lift
1531
+ errorHandler: FfiConverterTypeRecoveryError .lift
1532
1532
)
1533
1533
}
1534
1534
@@ -1568,7 +1568,7 @@ public class Encryption:
1568
1568
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer,
1569
1569
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_rust_buffer,
1570
1570
liftFunc: FfiConverterString.lift,
1571
- errorHandler: FfiConverterTypeClientError .lift
1571
+ errorHandler: FfiConverterTypeRecoveryError .lift
1572
1572
)
1573
1573
}
1574
1574
@@ -12764,6 +12764,71 @@ extension PusherKind: Equatable, Hashable {}
12764
12764
12765
12765
12766
12766
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
+
12767
12832
// Note that we don't yet support `indirect` for enums.
12768
12833
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
12769
12834
public enum RecoveryState {
@@ -14155,9 +14220,15 @@ public enum SteadyStateError {
14155
14220
14156
14221
14157
14222
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
+
14161
14232
14162
14233
fileprivate static func uniffiErrorHandler(_ error: RustBuffer) throws -> Error {
14163
14234
return try FfiConverterTypeSteadyStateError.lift(error)
@@ -14175,11 +14246,20 @@ public struct FfiConverterTypeSteadyStateError: FfiConverterRustBuffer {
14175
14246
14176
14247
14177
14248
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
+
14181
14261
14182
- default: throw UniffiInternalError.unexpectedEnumCase
14262
+ default: throw UniffiInternalError.unexpectedEnumCase
14183
14263
}
14184
14264
}
14185
14265
@@ -14189,17 +14269,13 @@ public struct FfiConverterTypeSteadyStateError: FfiConverterRustBuffer {
14189
14269
14190
14270
14191
14271
14192
-
14193
- case .BackupDisabled:
14272
+ case .BackupDisabled(_ /* message is ignored*/):
14194
14273
writeInt(&buf, Int32(1))
14195
-
14196
-
14197
- case .Connection:
14274
+ case .Connection(_ /* message is ignored*/):
14198
14275
writeInt(&buf, Int32(2))
14199
-
14200
-
14201
- case .Lagged:
14276
+ case .Lagged(_ /* message is ignored*/):
14202
14277
writeInt(&buf, Int32(3))
14278
+
14203
14279
14204
14280
}
14205
14281
}
@@ -18525,22 +18601,22 @@ private var initializationResult: InitializationResult {
18525
18601
if (uniffi_matrix_sdk_ffi_checksum_method_encryption_backup_state_listener() != 29) {
18526
18602
return InitializationResult.apiChecksumMismatch
18527
18603
}
18528
- if (uniffi_matrix_sdk_ffi_checksum_method_encryption_disable_recovery() != 56498 ) {
18604
+ if (uniffi_matrix_sdk_ffi_checksum_method_encryption_disable_recovery() != 38729 ) {
18529
18605
return InitializationResult.apiChecksumMismatch
18530
18606
}
18531
- if (uniffi_matrix_sdk_ffi_checksum_method_encryption_enable_backups() != 38094 ) {
18607
+ if (uniffi_matrix_sdk_ffi_checksum_method_encryption_enable_backups() != 30690 ) {
18532
18608
return InitializationResult.apiChecksumMismatch
18533
18609
}
18534
- if (uniffi_matrix_sdk_ffi_checksum_method_encryption_enable_recovery() != 13489 ) {
18610
+ if (uniffi_matrix_sdk_ffi_checksum_method_encryption_enable_recovery() != 60849 ) {
18535
18611
return InitializationResult.apiChecksumMismatch
18536
18612
}
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 ) {
18538
18614
return InitializationResult.apiChecksumMismatch
18539
18615
}
18540
- if (uniffi_matrix_sdk_ffi_checksum_method_encryption_recover() != 29174 ) {
18616
+ if (uniffi_matrix_sdk_ffi_checksum_method_encryption_recover() != 34668 ) {
18541
18617
return InitializationResult.apiChecksumMismatch
18542
18618
}
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 ) {
18544
18620
return InitializationResult.apiChecksumMismatch
18545
18621
}
18546
18622
if (uniffi_matrix_sdk_ffi_checksum_method_encryption_recovery_state() != 7187) {
@@ -18549,7 +18625,7 @@ private var initializationResult: InitializationResult {
18549
18625
if (uniffi_matrix_sdk_ffi_checksum_method_encryption_recovery_state_listener() != 11439) {
18550
18626
return InitializationResult.apiChecksumMismatch
18551
18627
}
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 ) {
18553
18629
return InitializationResult.apiChecksumMismatch
18554
18630
}
18555
18631
if (uniffi_matrix_sdk_ffi_checksum_method_encryption_wait_for_backup_upload_steady_state() != 37083) {
0 commit comments