Skip to content

Commit

Permalink
Bump to version v1.1.65 (matrix-rust-sdk/main 74b79d8212f1f4f161625ba…
Browse files Browse the repository at this point in the history
…d34acfb4acf8ff65f)
  • Loading branch information
pixlwave committed May 8, 2024
1 parent 015d484 commit e43f959
Show file tree
Hide file tree
Showing 6 changed files with 2,166 additions and 3,085 deletions.
7 changes: 2 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let checksum = "8edfe74e9f1689539585832f864c1fe7ef93f3a71595ac9acf395ea40a8c0373"
let version = "v0.0.2-qr-login"
let checksum = "c14248b8f89a32a37b210284ce1d41264d92727b1d09f0285b0ff09472ad27cf"
let version = "v1.1.65"
let url = "https://github.com/matrix-org/matrix-rust-components-swift/releases/download/\(version)/MatrixSDKFFI.xcframework.zip"

let package = Package(
name: "MatrixRustSDK",
platforms: [
Expand Down
13 changes: 13 additions & 0 deletions Sources/MatrixRustSDK/matrix_sdk.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ fileprivate extension RustBuffer {
self.init(capacity: rbuf.capacity, len: rbuf.len, data: rbuf.data)
}

static func empty() -> RustBuffer {
RustBuffer(capacity: 0, len:0, data: nil)
}

static func from(_ ptr: UnsafeBufferPointer<UInt8>) -> RustBuffer {
try! rustCall { ffi_matrix_sdk_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) }
}
Expand Down Expand Up @@ -365,6 +369,12 @@ fileprivate class UniffiHandleMap<T> {
return obj
}
}

var count: Int {
get {
map.count
}
}
}


Expand Down Expand Up @@ -517,6 +527,7 @@ public struct RoomPowerLevelChanges {
}



extension RoomPowerLevelChanges: Equatable, Hashable {
public static func ==(lhs: RoomPowerLevelChanges, rhs: RoomPowerLevelChanges) -> Bool {
if lhs.ban != rhs.ban {
Expand Down Expand Up @@ -688,6 +699,7 @@ public func FfiConverterTypeBackupDownloadStrategy_lower(_ value: BackupDownload
}



extension BackupDownloadStrategy: Equatable, Hashable {}


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



extension RoomMemberRole: Equatable, Hashable {}


Expand Down
10 changes: 10 additions & 0 deletions Sources/MatrixRustSDK/matrix_sdk_base.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ fileprivate extension RustBuffer {
self.init(capacity: rbuf.capacity, len: rbuf.len, data: rbuf.data)
}

static func empty() -> RustBuffer {
RustBuffer(capacity: 0, len:0, data: nil)
}

static func from(_ ptr: UnsafeBufferPointer<UInt8>) -> RustBuffer {
try! rustCall { ffi_matrix_sdk_base_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) }
}
Expand Down Expand Up @@ -365,6 +369,12 @@ fileprivate class UniffiHandleMap<T> {
return obj
}
}

var count: Int {
get {
map.count
}
}
}


Expand Down
102 changes: 13 additions & 89 deletions Sources/MatrixRustSDK/matrix_sdk_crypto.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ fileprivate extension RustBuffer {
self.init(capacity: rbuf.capacity, len: rbuf.len, data: rbuf.data)
}

static func empty() -> RustBuffer {
RustBuffer(capacity: 0, len:0, data: nil)
}

static func from(_ ptr: UnsafeBufferPointer<UInt8>) -> RustBuffer {
try! rustCall { ffi_matrix_sdk_crypto_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) }
}
Expand Down Expand Up @@ -365,6 +369,12 @@ fileprivate class UniffiHandleMap<T> {
return obj
}
}

var count: Int {
get {
map.count
}
}
}


Expand Down Expand Up @@ -409,95 +419,6 @@ fileprivate struct FfiConverterString: FfiConverter {
}
}

// Note that we don't yet support `indirect` for enums.
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.

public enum CryptoQrCodeDecodeError {

case notEnoughData
case notUtf8
case urlParse
case invalidMode
case invalidVersion
case base64
case invalidPrefix
}


public struct FfiConverterTypeCryptoQrCodeDecodeError: FfiConverterRustBuffer {
typealias SwiftType = CryptoQrCodeDecodeError

public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> CryptoQrCodeDecodeError {
let variant: Int32 = try readInt(&buf)
switch variant {

case 1: return .notEnoughData

case 2: return .notUtf8

case 3: return .urlParse

case 4: return .invalidMode

case 5: return .invalidVersion

case 6: return .base64

case 7: return .invalidPrefix

default: throw UniffiInternalError.unexpectedEnumCase
}
}

public static func write(_ value: CryptoQrCodeDecodeError, into buf: inout [UInt8]) {
switch value {


case .notEnoughData:
writeInt(&buf, Int32(1))


case .notUtf8:
writeInt(&buf, Int32(2))


case .urlParse:
writeInt(&buf, Int32(3))


case .invalidMode:
writeInt(&buf, Int32(4))


case .invalidVersion:
writeInt(&buf, Int32(5))


case .base64:
writeInt(&buf, Int32(6))


case .invalidPrefix:
writeInt(&buf, Int32(7))

}
}
}


public func FfiConverterTypeCryptoQrCodeDecodeError_lift(_ buf: RustBuffer) throws -> CryptoQrCodeDecodeError {
return try FfiConverterTypeCryptoQrCodeDecodeError.lift(buf)
}

public func FfiConverterTypeCryptoQrCodeDecodeError_lower(_ value: CryptoQrCodeDecodeError) -> RustBuffer {
return FfiConverterTypeCryptoQrCodeDecodeError.lower(value)
}


extension CryptoQrCodeDecodeError: Equatable, Hashable {}



// Note that we don't yet support `indirect` for enums.
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
/**
Expand Down Expand Up @@ -577,6 +498,7 @@ public func FfiConverterTypeLocalTrust_lower(_ value: LocalTrust) -> RustBuffer
}



extension LocalTrust: Equatable, Hashable {}


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



extension SignatureState: Equatable, Hashable {}


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



extension UtdCause: Equatable, Hashable {}


Expand Down
Loading

0 comments on commit e43f959

Please sign in to comment.