Skip to content

Commit 410fa67

Browse files
committed
Bump to version v1.0.35 (matrix-rust-sdk/main 57963dc)
1 parent 6afcc93 commit 410fa67

File tree

2 files changed

+121
-2
lines changed

2 files changed

+121
-2
lines changed

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// swift-tools-version:5.9
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33
import PackageDescription
4-
let checksum = "ba1331e5188816f9422f94018e28e36d4f67a882dc79ecc5b7d35a7e24325a02"
5-
let version = "v1.0.34"
4+
let checksum = "792a0a43b54f6696222e6addff64c5538ad6a19a4f847dda5db23995db11a302"
5+
let version = "v1.0.35"
66
let url = "https://github.com/element-hq/matrix-rust-components-swift/releases/download/\(version)/MatrixSDKFFI.xcframework.zip"
77
let package = Package(
88
name: "MatrixRustSDK",

Sources/MatrixRustSDK/matrix_sdk_ffi.swift

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1858,6 +1858,11 @@ public protocol ClientBuilderProtocol : AnyObject {
18581858

18591859
func proxy(url: String) -> ClientBuilder
18601860

1861+
/**
1862+
* Add a default request config to this client.
1863+
*/
1864+
func requestConfig(config: RequestConfig) -> ClientBuilder
1865+
18611866
func requiresSlidingSync() -> ClientBuilder
18621867

18631868
func serverName(serverName: String) -> ClientBuilder
@@ -2079,6 +2084,17 @@ open func proxy(url: String) -> ClientBuilder {
20792084
FfiConverterString.lower(url),$0
20802085
)
20812086
})
2087+
}
2088+
2089+
/**
2090+
* Add a default request config to this client.
2091+
*/
2092+
open func requestConfig(config: RequestConfig) -> ClientBuilder {
2093+
return try! FfiConverterTypeClientBuilder.lift(try! rustCall() {
2094+
uniffi_matrix_sdk_ffi_fn_method_clientbuilder_request_config(self.uniffiClonePointer(),
2095+
FfiConverterTypeRequestConfig.lower(config),$0
2096+
)
2097+
})
20822098
}
20832099

20842100
open func requiresSlidingSync() -> ClientBuilder {
@@ -12751,6 +12767,106 @@ public func FfiConverterTypeReceipt_lower(_ value: Receipt) -> RustBuffer {
1275112767
}
1275212768

1275312769

12770+
/**
12771+
* The config to use for HTTP requests by default in this client.
12772+
*/
12773+
public struct RequestConfig {
12774+
/**
12775+
* Max number of retries.
12776+
*/
12777+
public var retryLimit: UInt64?
12778+
/**
12779+
* Timeout for a request in milliseconds.
12780+
*/
12781+
public var timeout: UInt64?
12782+
/**
12783+
* Max number of concurrent requests. No value means no limits.
12784+
*/
12785+
public var maxConcurrentRequests: UInt64?
12786+
/**
12787+
* Base delay between retries.
12788+
*/
12789+
public var retryTimeout: UInt64?
12790+
12791+
// Default memberwise initializers are never public by default, so we
12792+
// declare one manually.
12793+
public init(
12794+
/**
12795+
* Max number of retries.
12796+
*/retryLimit: UInt64?,
12797+
/**
12798+
* Timeout for a request in milliseconds.
12799+
*/timeout: UInt64?,
12800+
/**
12801+
* Max number of concurrent requests. No value means no limits.
12802+
*/maxConcurrentRequests: UInt64?,
12803+
/**
12804+
* Base delay between retries.
12805+
*/retryTimeout: UInt64?) {
12806+
self.retryLimit = retryLimit
12807+
self.timeout = timeout
12808+
self.maxConcurrentRequests = maxConcurrentRequests
12809+
self.retryTimeout = retryTimeout
12810+
}
12811+
}
12812+
12813+
12814+
12815+
extension RequestConfig: Equatable, Hashable {
12816+
public static func ==(lhs: RequestConfig, rhs: RequestConfig) -> Bool {
12817+
if lhs.retryLimit != rhs.retryLimit {
12818+
return false
12819+
}
12820+
if lhs.timeout != rhs.timeout {
12821+
return false
12822+
}
12823+
if lhs.maxConcurrentRequests != rhs.maxConcurrentRequests {
12824+
return false
12825+
}
12826+
if lhs.retryTimeout != rhs.retryTimeout {
12827+
return false
12828+
}
12829+
return true
12830+
}
12831+
12832+
public func hash(into hasher: inout Hasher) {
12833+
hasher.combine(retryLimit)
12834+
hasher.combine(timeout)
12835+
hasher.combine(maxConcurrentRequests)
12836+
hasher.combine(retryTimeout)
12837+
}
12838+
}
12839+
12840+
12841+
public struct FfiConverterTypeRequestConfig: FfiConverterRustBuffer {
12842+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> RequestConfig {
12843+
return
12844+
try RequestConfig(
12845+
retryLimit: FfiConverterOptionUInt64.read(from: &buf),
12846+
timeout: FfiConverterOptionUInt64.read(from: &buf),
12847+
maxConcurrentRequests: FfiConverterOptionUInt64.read(from: &buf),
12848+
retryTimeout: FfiConverterOptionUInt64.read(from: &buf)
12849+
)
12850+
}
12851+
12852+
public static func write(_ value: RequestConfig, into buf: inout [UInt8]) {
12853+
FfiConverterOptionUInt64.write(value.retryLimit, into: &buf)
12854+
FfiConverterOptionUInt64.write(value.timeout, into: &buf)
12855+
FfiConverterOptionUInt64.write(value.maxConcurrentRequests, into: &buf)
12856+
FfiConverterOptionUInt64.write(value.retryTimeout, into: &buf)
12857+
}
12858+
}
12859+
12860+
12861+
public func FfiConverterTypeRequestConfig_lift(_ buf: RustBuffer) throws -> RequestConfig {
12862+
return try FfiConverterTypeRequestConfig.lift(buf)
12863+
}
12864+
12865+
public func FfiConverterTypeRequestConfig_lower(_ value: RequestConfig) -> RustBuffer {
12866+
return FfiConverterTypeRequestConfig.lower(value)
12867+
}
12868+
12869+
1275412870
public struct RequiredState {
1275512871
public var key: String
1275612872
public var value: String
@@ -26544,6 +26660,9 @@ private var initializationResult: InitializationResult = {
2654426660
if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_proxy() != 5659) {
2654526661
return InitializationResult.apiChecksumMismatch
2654626662
}
26663+
if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_request_config() != 58783) {
26664+
return InitializationResult.apiChecksumMismatch
26665+
}
2654726666
if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_requires_sliding_sync() != 18165) {
2654826667
return InitializationResult.apiChecksumMismatch
2654926668
}

0 commit comments

Comments
 (0)