@@ -562,6 +562,7 @@ public protocol ClientProtocol {
562
562
func `logout`( ) throws
563
563
func `restoreSession`( `session`: Session ) throws
564
564
func `rooms`( ) -> [ Room ]
565
+ func `searchUsers`( `searchTerm`: String , `limit`: UInt64 ) throws -> SearchUsersResults
565
566
func `session`( ) throws -> Session
566
567
func `setAccountData`( `eventType`: String , `content`: String ) throws
567
568
func `setDisplayName`( `name`: String ) throws
@@ -791,6 +792,18 @@ public class Client: ClientProtocol {
791
792
)
792
793
}
793
794
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
+
794
807
public func `session`( ) throws -> Session {
795
808
return try FfiConverterTypeSession . lift (
796
809
try
@@ -5334,6 +5347,61 @@ public func FfiConverterTypeRoomSubscription_lower(_ value: RoomSubscription) ->
5334
5347
}
5335
5348
5336
5349
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
+
5337
5405
public struct Session {
5338
5406
public var `accessToken` : String
5339
5407
public var `refreshToken` : String ?
@@ -5797,6 +5865,69 @@ public func FfiConverterTypeUpdateSummary_lower(_ value: UpdateSummary) -> RustB
5797
5865
}
5798
5866
5799
5867
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
+
5800
5931
public struct VideoInfo {
5801
5932
public var `duration` : UInt64 ?
5802
5933
public var `height` : UInt64 ?
@@ -9751,6 +9882,28 @@ fileprivate struct FfiConverterSequenceTypeRequiredState: FfiConverterRustBuffer
9751
9882
}
9752
9883
}
9753
9884
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
+
9754
9907
fileprivate struct FfiConverterSequenceTypeRoomListEntry : FfiConverterRustBuffer {
9755
9908
typealias SwiftType = [ RoomListEntry ]
9756
9909
0 commit comments