Skip to content

Commit e43f959

Browse files
committedMay 8, 2024
Bump to version v1.1.65 (matrix-rust-sdk/main 74b79d8212f1f4f161625bad34acfb4acf8ff65f)
1 parent 015d484 commit e43f959

6 files changed

+2166
-3085
lines changed
 

‎Package.swift

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
// swift-tools-version:5.5
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
3-
43
import PackageDescription
5-
6-
let checksum = "8edfe74e9f1689539585832f864c1fe7ef93f3a71595ac9acf395ea40a8c0373"
7-
let version = "v0.0.2-qr-login"
4+
let checksum = "c14248b8f89a32a37b210284ce1d41264d92727b1d09f0285b0ff09472ad27cf"
5+
let version = "v1.1.65"
86
let url = "https://github.com/matrix-org/matrix-rust-components-swift/releases/download/\(version)/MatrixSDKFFI.xcframework.zip"
9-
107
let package = Package(
118
name: "MatrixRustSDK",
129
platforms: [

‎Sources/MatrixRustSDK/matrix_sdk.swift

+13
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ fileprivate extension RustBuffer {
2020
self.init(capacity: rbuf.capacity, len: rbuf.len, data: rbuf.data)
2121
}
2222

23+
static func empty() -> RustBuffer {
24+
RustBuffer(capacity: 0, len:0, data: nil)
25+
}
26+
2327
static func from(_ ptr: UnsafeBufferPointer<UInt8>) -> RustBuffer {
2428
try! rustCall { ffi_matrix_sdk_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) }
2529
}
@@ -365,6 +369,12 @@ fileprivate class UniffiHandleMap<T> {
365369
return obj
366370
}
367371
}
372+
373+
var count: Int {
374+
get {
375+
map.count
376+
}
377+
}
368378
}
369379

370380

@@ -517,6 +527,7 @@ public struct RoomPowerLevelChanges {
517527
}
518528

519529

530+
520531
extension RoomPowerLevelChanges: Equatable, Hashable {
521532
public static func ==(lhs: RoomPowerLevelChanges, rhs: RoomPowerLevelChanges) -> Bool {
522533
if lhs.ban != rhs.ban {
@@ -688,6 +699,7 @@ public func FfiConverterTypeBackupDownloadStrategy_lower(_ value: BackupDownload
688699
}
689700

690701

702+
691703
extension BackupDownloadStrategy: Equatable, Hashable {}
692704

693705

@@ -761,6 +773,7 @@ public func FfiConverterTypeRoomMemberRole_lower(_ value: RoomMemberRole) -> Rus
761773
}
762774

763775

776+
764777
extension RoomMemberRole: Equatable, Hashable {}
765778

766779

‎Sources/MatrixRustSDK/matrix_sdk_base.swift

+10
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ fileprivate extension RustBuffer {
2020
self.init(capacity: rbuf.capacity, len: rbuf.len, data: rbuf.data)
2121
}
2222

23+
static func empty() -> RustBuffer {
24+
RustBuffer(capacity: 0, len:0, data: nil)
25+
}
26+
2327
static func from(_ ptr: UnsafeBufferPointer<UInt8>) -> RustBuffer {
2428
try! rustCall { ffi_matrix_sdk_base_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) }
2529
}
@@ -365,6 +369,12 @@ fileprivate class UniffiHandleMap<T> {
365369
return obj
366370
}
367371
}
372+
373+
var count: Int {
374+
get {
375+
map.count
376+
}
377+
}
368378
}
369379

370380

‎Sources/MatrixRustSDK/matrix_sdk_crypto.swift

+13-89
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ fileprivate extension RustBuffer {
2020
self.init(capacity: rbuf.capacity, len: rbuf.len, data: rbuf.data)
2121
}
2222

23+
static func empty() -> RustBuffer {
24+
RustBuffer(capacity: 0, len:0, data: nil)
25+
}
26+
2327
static func from(_ ptr: UnsafeBufferPointer<UInt8>) -> RustBuffer {
2428
try! rustCall { ffi_matrix_sdk_crypto_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) }
2529
}
@@ -365,6 +369,12 @@ fileprivate class UniffiHandleMap<T> {
365369
return obj
366370
}
367371
}
372+
373+
var count: Int {
374+
get {
375+
map.count
376+
}
377+
}
368378
}
369379

370380

@@ -409,95 +419,6 @@ fileprivate struct FfiConverterString: FfiConverter {
409419
}
410420
}
411421

412-
// Note that we don't yet support `indirect` for enums.
413-
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
414-
415-
public enum CryptoQrCodeDecodeError {
416-
417-
case notEnoughData
418-
case notUtf8
419-
case urlParse
420-
case invalidMode
421-
case invalidVersion
422-
case base64
423-
case invalidPrefix
424-
}
425-
426-
427-
public struct FfiConverterTypeCryptoQrCodeDecodeError: FfiConverterRustBuffer {
428-
typealias SwiftType = CryptoQrCodeDecodeError
429-
430-
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> CryptoQrCodeDecodeError {
431-
let variant: Int32 = try readInt(&buf)
432-
switch variant {
433-
434-
case 1: return .notEnoughData
435-
436-
case 2: return .notUtf8
437-
438-
case 3: return .urlParse
439-
440-
case 4: return .invalidMode
441-
442-
case 5: return .invalidVersion
443-
444-
case 6: return .base64
445-
446-
case 7: return .invalidPrefix
447-
448-
default: throw UniffiInternalError.unexpectedEnumCase
449-
}
450-
}
451-
452-
public static func write(_ value: CryptoQrCodeDecodeError, into buf: inout [UInt8]) {
453-
switch value {
454-
455-
456-
case .notEnoughData:
457-
writeInt(&buf, Int32(1))
458-
459-
460-
case .notUtf8:
461-
writeInt(&buf, Int32(2))
462-
463-
464-
case .urlParse:
465-
writeInt(&buf, Int32(3))
466-
467-
468-
case .invalidMode:
469-
writeInt(&buf, Int32(4))
470-
471-
472-
case .invalidVersion:
473-
writeInt(&buf, Int32(5))
474-
475-
476-
case .base64:
477-
writeInt(&buf, Int32(6))
478-
479-
480-
case .invalidPrefix:
481-
writeInt(&buf, Int32(7))
482-
483-
}
484-
}
485-
}
486-
487-
488-
public func FfiConverterTypeCryptoQrCodeDecodeError_lift(_ buf: RustBuffer) throws -> CryptoQrCodeDecodeError {
489-
return try FfiConverterTypeCryptoQrCodeDecodeError.lift(buf)
490-
}
491-
492-
public func FfiConverterTypeCryptoQrCodeDecodeError_lower(_ value: CryptoQrCodeDecodeError) -> RustBuffer {
493-
return FfiConverterTypeCryptoQrCodeDecodeError.lower(value)
494-
}
495-
496-
497-
extension CryptoQrCodeDecodeError: Equatable, Hashable {}
498-
499-
500-
501422
// Note that we don't yet support `indirect` for enums.
502423
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
503424
/**
@@ -577,6 +498,7 @@ public func FfiConverterTypeLocalTrust_lower(_ value: LocalTrust) -> RustBuffer
577498
}
578499

579500

501+
580502
extension LocalTrust: Equatable, Hashable {}
581503

582504

@@ -662,6 +584,7 @@ public func FfiConverterTypeSignatureState_lower(_ value: SignatureState) -> Rus
662584
}
663585

664586

587+
665588
extension SignatureState: Equatable, Hashable {}
666589

667590

@@ -727,6 +650,7 @@ public func FfiConverterTypeUtdCause_lower(_ value: UtdCause) -> RustBuffer {
727650
}
728651

729652

653+
730654
extension UtdCause: Equatable, Hashable {}
731655

732656

‎Sources/MatrixRustSDK/matrix_sdk_ffi.swift

+2,116-2,991
Large diffs are not rendered by default.

‎Sources/MatrixRustSDK/matrix_sdk_ui.swift

+12
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ fileprivate extension RustBuffer {
2020
self.init(capacity: rbuf.capacity, len: rbuf.len, data: rbuf.data)
2121
}
2222

23+
static func empty() -> RustBuffer {
24+
RustBuffer(capacity: 0, len:0, data: nil)
25+
}
26+
2327
static func from(_ ptr: UnsafeBufferPointer<UInt8>) -> RustBuffer {
2428
try! rustCall { ffi_matrix_sdk_ui_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) }
2529
}
@@ -365,6 +369,12 @@ fileprivate class UniffiHandleMap<T> {
365369
return obj
366370
}
367371
}
372+
373+
var count: Int {
374+
get {
375+
map.count
376+
}
377+
}
368378
}
369379

370380

@@ -478,6 +488,7 @@ public func FfiConverterTypeEventItemOrigin_lower(_ value: EventItemOrigin) -> R
478488
}
479489

480490

491+
481492
extension EventItemOrigin: Equatable, Hashable {}
482493

483494

@@ -552,6 +563,7 @@ public func FfiConverterTypePaginationStatus_lower(_ value: PaginationStatus) ->
552563
}
553564

554565

566+
555567
extension PaginationStatus: Equatable, Hashable {}
556568

557569

0 commit comments

Comments
 (0)
Please sign in to comment.