Skip to content

Commit 9eee9ba

Browse files
committed
Bump to v1.0.48-alpha (matrix-rust-sdk f70b6f5ecf3439dd522548ef30edf167ed330163)
1 parent 4b6e963 commit 9eee9ba

File tree

2 files changed

+154
-1
lines changed

2 files changed

+154
-1
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import PackageDescription
55

6-
let checksum = "dcea1b6d629fb82959bab2ebcb64561825aa8c2bad8c5bf544d06108f9cf4fbd"
6+
let checksum = "2eb8e0db39d24eed3b958d5c8cff6b8fa0e86dbf89b7cdb8d8c8dcf153cd3d11"
77
let version = "v1.0.48-alpha"
88
let url = "https://github.com/matrix-org/matrix-rust-components-swift/releases/download/\(version)/MatrixSDKFFI.xcframework.zip"
99

Sources/MatrixRustSDK/matrix_sdk_ffi.swift

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,7 @@ public protocol ClientProtocol {
562562
func `logout`() throws
563563
func `restoreSession`(`session`: Session) throws
564564
func `rooms`() -> [Room]
565+
func `searchUsers`(`searchTerm`: String, `limit`: UInt64) throws -> SearchUsersResults
565566
func `session`() throws -> Session
566567
func `setAccountData`(`eventType`: String, `content`: String) throws
567568
func `setDisplayName`(`name`: String) throws
@@ -791,6 +792,18 @@ public class Client: ClientProtocol {
791792
)
792793
}
793794

795+
public func `searchUsers`(`searchTerm`: String, `limit`: UInt64) throws -> SearchUsersResults {
796+
return try FfiConverterTypeSearchUsersResults.lift(
797+
try
798+
rustCallWithError(FfiConverterTypeClientError.self) {
799+
_uniffi_matrix_sdk_ffi_impl_Client_search_users_f239(self.pointer,
800+
FfiConverterString.lower(`searchTerm`),
801+
FfiConverterUInt64.lower(`limit`), $0
802+
)
803+
}
804+
)
805+
}
806+
794807
public func `session`() throws -> Session {
795808
return try FfiConverterTypeSession.lift(
796809
try
@@ -5334,6 +5347,61 @@ public func FfiConverterTypeRoomSubscription_lower(_ value: RoomSubscription) ->
53345347
}
53355348

53365349

5350+
public struct SearchUsersResults {
5351+
public var `results`: [UserProfile]
5352+
public var `limited`: Bool
5353+
5354+
// Default memberwise initializers are never public by default, so we
5355+
// declare one manually.
5356+
public init(`results`: [UserProfile], `limited`: Bool) {
5357+
self.`results` = `results`
5358+
self.`limited` = `limited`
5359+
}
5360+
}
5361+
5362+
5363+
extension SearchUsersResults: Equatable, Hashable {
5364+
public static func ==(lhs: SearchUsersResults, rhs: SearchUsersResults) -> Bool {
5365+
if lhs.`results` != rhs.`results` {
5366+
return false
5367+
}
5368+
if lhs.`limited` != rhs.`limited` {
5369+
return false
5370+
}
5371+
return true
5372+
}
5373+
5374+
public func hash(into hasher: inout Hasher) {
5375+
hasher.combine(`results`)
5376+
hasher.combine(`limited`)
5377+
}
5378+
}
5379+
5380+
5381+
public struct FfiConverterTypeSearchUsersResults: FfiConverterRustBuffer {
5382+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SearchUsersResults {
5383+
return try SearchUsersResults(
5384+
`results`: FfiConverterSequenceTypeUserProfile.read(from: &buf),
5385+
`limited`: FfiConverterBool.read(from: &buf)
5386+
)
5387+
}
5388+
5389+
public static func write(_ value: SearchUsersResults, into buf: inout [UInt8]) {
5390+
FfiConverterSequenceTypeUserProfile.write(value.`results`, into: &buf)
5391+
FfiConverterBool.write(value.`limited`, into: &buf)
5392+
}
5393+
}
5394+
5395+
5396+
public func FfiConverterTypeSearchUsersResults_lift(_ buf: RustBuffer) throws -> SearchUsersResults {
5397+
return try FfiConverterTypeSearchUsersResults.lift(buf)
5398+
}
5399+
5400+
public func FfiConverterTypeSearchUsersResults_lower(_ value: SearchUsersResults) -> RustBuffer {
5401+
return FfiConverterTypeSearchUsersResults.lower(value)
5402+
}
5403+
5404+
53375405
public struct Session {
53385406
public var `accessToken`: String
53395407
public var `refreshToken`: String?
@@ -5797,6 +5865,69 @@ public func FfiConverterTypeUpdateSummary_lower(_ value: UpdateSummary) -> RustB
57975865
}
57985866

57995867

5868+
public struct UserProfile {
5869+
public var `userId`: String
5870+
public var `displayName`: String?
5871+
public var `avatarUrl`: String?
5872+
5873+
// Default memberwise initializers are never public by default, so we
5874+
// declare one manually.
5875+
public init(`userId`: String, `displayName`: String?, `avatarUrl`: String?) {
5876+
self.`userId` = `userId`
5877+
self.`displayName` = `displayName`
5878+
self.`avatarUrl` = `avatarUrl`
5879+
}
5880+
}
5881+
5882+
5883+
extension UserProfile: Equatable, Hashable {
5884+
public static func ==(lhs: UserProfile, rhs: UserProfile) -> Bool {
5885+
if lhs.`userId` != rhs.`userId` {
5886+
return false
5887+
}
5888+
if lhs.`displayName` != rhs.`displayName` {
5889+
return false
5890+
}
5891+
if lhs.`avatarUrl` != rhs.`avatarUrl` {
5892+
return false
5893+
}
5894+
return true
5895+
}
5896+
5897+
public func hash(into hasher: inout Hasher) {
5898+
hasher.combine(`userId`)
5899+
hasher.combine(`displayName`)
5900+
hasher.combine(`avatarUrl`)
5901+
}
5902+
}
5903+
5904+
5905+
public struct FfiConverterTypeUserProfile: FfiConverterRustBuffer {
5906+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UserProfile {
5907+
return try UserProfile(
5908+
`userId`: FfiConverterString.read(from: &buf),
5909+
`displayName`: FfiConverterOptionString.read(from: &buf),
5910+
`avatarUrl`: FfiConverterOptionString.read(from: &buf)
5911+
)
5912+
}
5913+
5914+
public static func write(_ value: UserProfile, into buf: inout [UInt8]) {
5915+
FfiConverterString.write(value.`userId`, into: &buf)
5916+
FfiConverterOptionString.write(value.`displayName`, into: &buf)
5917+
FfiConverterOptionString.write(value.`avatarUrl`, into: &buf)
5918+
}
5919+
}
5920+
5921+
5922+
public func FfiConverterTypeUserProfile_lift(_ buf: RustBuffer) throws -> UserProfile {
5923+
return try FfiConverterTypeUserProfile.lift(buf)
5924+
}
5925+
5926+
public func FfiConverterTypeUserProfile_lower(_ value: UserProfile) -> RustBuffer {
5927+
return FfiConverterTypeUserProfile.lower(value)
5928+
}
5929+
5930+
58005931
public struct VideoInfo {
58015932
public var `duration`: UInt64?
58025933
public var `height`: UInt64?
@@ -9751,6 +9882,28 @@ fileprivate struct FfiConverterSequenceTypeRequiredState: FfiConverterRustBuffer
97519882
}
97529883
}
97539884

9885+
fileprivate struct FfiConverterSequenceTypeUserProfile: FfiConverterRustBuffer {
9886+
typealias SwiftType = [UserProfile]
9887+
9888+
public static func write(_ value: [UserProfile], into buf: inout [UInt8]) {
9889+
let len = Int32(value.count)
9890+
writeInt(&buf, len)
9891+
for item in value {
9892+
FfiConverterTypeUserProfile.write(item, into: &buf)
9893+
}
9894+
}
9895+
9896+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [UserProfile] {
9897+
let len: Int32 = try readInt(&buf)
9898+
var seq = [UserProfile]()
9899+
seq.reserveCapacity(Int(len))
9900+
for _ in 0 ..< len {
9901+
seq.append(try FfiConverterTypeUserProfile.read(from: &buf))
9902+
}
9903+
return seq
9904+
}
9905+
}
9906+
97549907
fileprivate struct FfiConverterSequenceTypeRoomListEntry: FfiConverterRustBuffer {
97559908
typealias SwiftType = [RoomListEntry]
97569909

0 commit comments

Comments
 (0)