Skip to content

Commit

Permalink
Bump to version v1.0.20 (matrix-rust-sdk/main 52fa00e47423bd7c378b623…
Browse files Browse the repository at this point in the history
…36de6ad3c9d24569b)
  • Loading branch information
pixlwave committed Jul 1, 2024
1 parent fdcfb5e commit 2a5feab
Show file tree
Hide file tree
Showing 2 changed files with 167 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// swift-tools-version:5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let checksum = "3da332b032df25c5771c0201e893c50c423bd4e1b7ee9c10d26d2e974de850f1"
let version = "v1.0.19"
let checksum = "dd72ac45f22cfc4e8f8a4097e4089a8b5431b077b7d598efbd99a29acbb11a12"
let version = "v1.0.20"
let url = "https://github.com/element-hq/matrix-rust-components-swift/releases/download/\(version)/MatrixSDKFFI.xcframework.zip"
let package = Package(
name: "MatrixRustSDK",
Expand Down
165 changes: 165 additions & 0 deletions Sources/MatrixRustSDK/matrix_sdk_ffi.swift
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,12 @@ public protocol ClientProtocol : AnyObject {

func getSessionVerificationController() async throws -> SessionVerificationController

/**
* Allows generic GET requests to be made through the SDKs internal HTTP
* client
*/
func getUrl(url: String) async throws -> String

/**
* The homeserver this client is configured to use.
*/
Expand Down Expand Up @@ -777,6 +783,11 @@ public protocol ClientProtocol : AnyObject {

func userId() throws -> String

/**
* The server name part of the current user ID
*/
func userIdServerName() throws -> String

}

open class Client:
Expand Down Expand Up @@ -1169,6 +1180,27 @@ open func getSessionVerificationController()async throws -> SessionVerification
)
}

/**
* Allows generic GET requests to be made through the SDKs internal HTTP
* client
*/
open func getUrl(url: String)async throws -> String {
return
try await uniffiRustCallAsync(
rustFutureFunc: {
uniffi_matrix_sdk_ffi_fn_method_client_get_url(
self.uniffiClonePointer(),
FfiConverterString.lower(url)
)
},
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer,
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer,
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_rust_buffer,
liftFunc: FfiConverterString.lift,
errorHandler: FfiConverterTypeClientError.lift
)
}

/**
* The homeserver this client is configured to use.
*/
Expand Down Expand Up @@ -1653,6 +1685,16 @@ open func userId()throws -> String {
})
}

/**
* The server name part of the current user ID
*/
open func userIdServerName()throws -> String {
return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeClientError.lift) {
uniffi_matrix_sdk_ffi_fn_method_client_user_id_server_name(self.uniffiClonePointer(),$0
)
})
}


}

Expand Down Expand Up @@ -10130,6 +10172,110 @@ public func FfiConverterTypeCreateRoomParameters_lower(_ value: CreateRoomParame
}


/**
* Well-known settings specific to ElementCall
*/
public struct ElementCallWellKnown {
public var widgetUrl: String

// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(widgetUrl: String) {
self.widgetUrl = widgetUrl
}
}



extension ElementCallWellKnown: Equatable, Hashable {
public static func ==(lhs: ElementCallWellKnown, rhs: ElementCallWellKnown) -> Bool {
if lhs.widgetUrl != rhs.widgetUrl {
return false
}
return true
}

public func hash(into hasher: inout Hasher) {
hasher.combine(widgetUrl)
}
}


public struct FfiConverterTypeElementCallWellKnown: FfiConverterRustBuffer {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ElementCallWellKnown {
return
try ElementCallWellKnown(
widgetUrl: FfiConverterString.read(from: &buf)
)
}

public static func write(_ value: ElementCallWellKnown, into buf: inout [UInt8]) {
FfiConverterString.write(value.widgetUrl, into: &buf)
}
}


public func FfiConverterTypeElementCallWellKnown_lift(_ buf: RustBuffer) throws -> ElementCallWellKnown {
return try FfiConverterTypeElementCallWellKnown.lift(buf)
}

public func FfiConverterTypeElementCallWellKnown_lower(_ value: ElementCallWellKnown) -> RustBuffer {
return FfiConverterTypeElementCallWellKnown.lower(value)
}


/**
* Element specific well-known settings
*/
public struct ElementWellKnown {
public var call: ElementCallWellKnown

// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(call: ElementCallWellKnown) {
self.call = call
}
}



extension ElementWellKnown: Equatable, Hashable {
public static func ==(lhs: ElementWellKnown, rhs: ElementWellKnown) -> Bool {
if lhs.call != rhs.call {
return false
}
return true
}

public func hash(into hasher: inout Hasher) {
hasher.combine(call)
}
}


public struct FfiConverterTypeElementWellKnown: FfiConverterRustBuffer {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ElementWellKnown {
return
try ElementWellKnown(
call: FfiConverterTypeElementCallWellKnown.read(from: &buf)
)
}

public static func write(_ value: ElementWellKnown, into buf: inout [UInt8]) {
FfiConverterTypeElementCallWellKnown.write(value.call, into: &buf)
}
}


public func FfiConverterTypeElementWellKnown_lift(_ buf: RustBuffer) throws -> ElementWellKnown {
return try FfiConverterTypeElementWellKnown.lift(buf)
}

public func FfiConverterTypeElementWellKnown_lower(_ value: ElementWellKnown) -> RustBuffer {
return FfiConverterTypeElementWellKnown.lower(value)
}


public struct EmoteMessageContent {
public var body: String
public var formatted: FormattedBody?
Expand Down Expand Up @@ -24850,6 +24996,16 @@ public func logEvent(file: String, line: UInt32?, level: LogLevel, target: Strin
)
}
}
/**
* Helper function to parse a string into a ElementWellKnown struct
*/
public func makeElementWellKnown(string: String)throws -> ElementWellKnown {
return try FfiConverterTypeElementWellKnown.lift(try rustCallWithError(FfiConverterTypeClientError.lift) {
uniffi_matrix_sdk_ffi_fn_func_make_element_well_known(
FfiConverterString.lower(string),$0
)
})
}
public func makeWidgetDriver(settings: WidgetSettings)throws -> WidgetDriverAndHandle {
return try FfiConverterTypeWidgetDriverAndHandle.lift(try rustCallWithError(FfiConverterTypeParseError.lift) {
uniffi_matrix_sdk_ffi_fn_func_make_widget_driver(
Expand Down Expand Up @@ -25008,6 +25164,9 @@ private var initializationResult: InitializationResult {
if (uniffi_matrix_sdk_ffi_checksum_func_log_event() != 62286) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_matrix_sdk_ffi_checksum_func_make_element_well_known() != 21379) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_matrix_sdk_ffi_checksum_func_make_widget_driver() != 34206) {
return InitializationResult.apiChecksumMismatch
}
Expand Down Expand Up @@ -25125,6 +25284,9 @@ private var initializationResult: InitializationResult {
if (uniffi_matrix_sdk_ffi_checksum_method_client_get_session_verification_controller() != 55934) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_matrix_sdk_ffi_checksum_method_client_get_url() != 50489) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_matrix_sdk_ffi_checksum_method_client_homeserver() != 26427) {
return InitializationResult.apiChecksumMismatch
}
Expand Down Expand Up @@ -25215,6 +25377,9 @@ private var initializationResult: InitializationResult {
if (uniffi_matrix_sdk_ffi_checksum_method_client_user_id() != 40531) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_matrix_sdk_ffi_checksum_method_client_user_id_server_name() != 57725) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_add_root_certificates() != 14763) {
return InitializationResult.apiChecksumMismatch
}
Expand Down

0 comments on commit 2a5feab

Please sign in to comment.