Skip to content

Commit

Permalink
Bump to v0.0.2-qr-login (matrix-rust-sdk/poljar/qr-login d3164955bfa7…
Browse files Browse the repository at this point in the history
…f616e01018c64e65d5c331ba8428)
  • Loading branch information
Velin92 committed May 7, 2024
1 parent f1ea6a1 commit 595e69f
Show file tree
Hide file tree
Showing 3 changed files with 461 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import PackageDescription

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

let package = Package(
Expand Down
89 changes: 89 additions & 0 deletions Sources/MatrixRustSDK/matrix_sdk_crypto.swift
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,95 @@ 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
Loading

0 comments on commit 595e69f

Please sign in to comment.