@@ -1150,6 +1150,87 @@ public func FfiConverterTypeSuggestStoreBuilder_lower(_ value: SuggestStoreBuild
1150
1150
}
1151
1151
1152
1152
1153
+ /**
1154
+ * Additional data about how an FTS match was made
1155
+ */
1156
+ public struct FtsMatchInfo {
1157
+ /**
1158
+ * Was this a prefix match (`water b` matched against `water bottle`)
1159
+ */
1160
+ public var prefix : Bool
1161
+ /**
1162
+ * Did the match require stemming? (`run shoes` matched against `running shoes`)
1163
+ */
1164
+ public var stemming : Bool
1165
+
1166
+ // Default memberwise initializers are never public by default, so we
1167
+ // declare one manually.
1168
+ public init (
1169
+ /**
1170
+ * Was this a prefix match (`water b` matched against `water bottle`)
1171
+ */prefix: Bool ,
1172
+ /**
1173
+ * Did the match require stemming? (`run shoes` matched against `running shoes`)
1174
+ */stemming: Bool ) {
1175
+ self . prefix = prefix
1176
+ self . stemming = stemming
1177
+ }
1178
+ }
1179
+
1180
+
1181
+
1182
+ extension FtsMatchInfo : Equatable , Hashable {
1183
+ public static func == ( lhs: FtsMatchInfo , rhs: FtsMatchInfo ) -> Bool {
1184
+ if lhs. prefix != rhs. prefix {
1185
+ return false
1186
+ }
1187
+ if lhs. stemming != rhs. stemming {
1188
+ return false
1189
+ }
1190
+ return true
1191
+ }
1192
+
1193
+ public func hash( into hasher: inout Hasher ) {
1194
+ hasher. combine ( prefix)
1195
+ hasher. combine ( stemming)
1196
+ }
1197
+ }
1198
+
1199
+
1200
+ #if swift(>=5.8)
1201
+ @_documentation ( visibility: private)
1202
+ #endif
1203
+ public struct FfiConverterTypeFtsMatchInfo : FfiConverterRustBuffer {
1204
+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> FtsMatchInfo {
1205
+ return
1206
+ try FtsMatchInfo (
1207
+ prefix: FfiConverterBool . read ( from: & buf) ,
1208
+ stemming: FfiConverterBool . read ( from: & buf)
1209
+ )
1210
+ }
1211
+
1212
+ public static func write( _ value: FtsMatchInfo , into buf: inout [ UInt8 ] ) {
1213
+ FfiConverterBool . write ( value. prefix, into: & buf)
1214
+ FfiConverterBool . write ( value. stemming, into: & buf)
1215
+ }
1216
+ }
1217
+
1218
+
1219
+ #if swift(>=5.8)
1220
+ @_documentation ( visibility: private)
1221
+ #endif
1222
+ public func FfiConverterTypeFtsMatchInfo_lift( _ buf: RustBuffer ) throws -> FtsMatchInfo {
1223
+ return try FfiConverterTypeFtsMatchInfo . lift ( buf)
1224
+ }
1225
+
1226
+ #if swift(>=5.8)
1227
+ @_documentation ( visibility: private)
1228
+ #endif
1229
+ public func FfiConverterTypeFtsMatchInfo_lower( _ value: FtsMatchInfo ) -> RustBuffer {
1230
+ return FfiConverterTypeFtsMatchInfo . lower ( value)
1231
+ }
1232
+
1233
+
1153
1234
/**
1154
1235
* A single geographic place.
1155
1236
*
@@ -2361,7 +2442,7 @@ public enum Suggestion {
2361
2442
)
2362
2443
case weather( city: String ? , region: String ? , country: String ? , latitude: Double ? , longitude: Double ? , score: Double
2363
2444
)
2364
- case fakespot( fakespotGrade: String , productId: String , rating: Double , title: String , totalReviews: Int64 , url: String , icon: Data ? , iconMimetype: String ? , score: Double
2445
+ case fakespot( fakespotGrade: String , productId: String , rating: Double , title: String , totalReviews: Int64 , url: String , icon: Data ? , iconMimetype: String ? , score: Double , matchInfo : FtsMatchInfo ?
2365
2446
)
2366
2447
case exposure( suggestionType: String , score: Double
2367
2448
)
@@ -2399,7 +2480,7 @@ public struct FfiConverterTypeSuggestion: FfiConverterRustBuffer {
2399
2480
case 7 : return . weather( city: try FfiConverterOptionString . read ( from: & buf) , region: try FfiConverterOptionString . read ( from: & buf) , country: try FfiConverterOptionString . read ( from: & buf) , latitude: try FfiConverterOptionDouble . read ( from: & buf) , longitude: try FfiConverterOptionDouble . read ( from: & buf) , score: try FfiConverterDouble . read ( from: & buf)
2400
2481
)
2401
2482
2402
- case 8 : return . fakespot( fakespotGrade: try FfiConverterString . read ( from: & buf) , productId: try FfiConverterString . read ( from: & buf) , rating: try FfiConverterDouble . read ( from: & buf) , title: try FfiConverterString . read ( from: & buf) , totalReviews: try FfiConverterInt64 . read ( from: & buf) , url: try FfiConverterString . read ( from: & buf) , icon: try FfiConverterOptionData . read ( from: & buf) , iconMimetype: try FfiConverterOptionString . read ( from: & buf) , score: try FfiConverterDouble . read ( from: & buf)
2483
+ case 8 : return . fakespot( fakespotGrade: try FfiConverterString . read ( from: & buf) , productId: try FfiConverterString . read ( from: & buf) , rating: try FfiConverterDouble . read ( from: & buf) , title: try FfiConverterString . read ( from: & buf) , totalReviews: try FfiConverterInt64 . read ( from: & buf) , url: try FfiConverterString . read ( from: & buf) , icon: try FfiConverterOptionData . read ( from: & buf) , iconMimetype: try FfiConverterOptionString . read ( from: & buf) , score: try FfiConverterDouble . read ( from: & buf) , matchInfo : try FfiConverterOptionTypeFtsMatchInfo . read ( from : & buf )
2403
2484
)
2404
2485
2405
2486
case 9 : return . exposure( suggestionType: try FfiConverterString . read ( from: & buf) , score: try FfiConverterDouble . read ( from: & buf)
@@ -2489,7 +2570,7 @@ public struct FfiConverterTypeSuggestion: FfiConverterRustBuffer {
2489
2570
FfiConverterDouble . write ( score, into: & buf)
2490
2571
2491
2572
2492
- case let . fakespot( fakespotGrade, productId, rating, title, totalReviews, url, icon, iconMimetype, score) :
2573
+ case let . fakespot( fakespotGrade, productId, rating, title, totalReviews, url, icon, iconMimetype, score, matchInfo ) :
2493
2574
writeInt ( & buf, Int32 ( 8 ) )
2494
2575
FfiConverterString . write ( fakespotGrade, into: & buf)
2495
2576
FfiConverterString . write ( productId, into: & buf)
@@ -2500,6 +2581,7 @@ public struct FfiConverterTypeSuggestion: FfiConverterRustBuffer {
2500
2581
FfiConverterOptionData . write ( icon, into: & buf)
2501
2582
FfiConverterOptionString . write ( iconMimetype, into: & buf)
2502
2583
FfiConverterDouble . write ( score, into: & buf)
2584
+ FfiConverterOptionTypeFtsMatchInfo . write ( matchInfo, into: & buf)
2503
2585
2504
2586
2505
2587
case let . exposure( suggestionType, score) :
@@ -2751,6 +2833,30 @@ fileprivate struct FfiConverterOptionData: FfiConverterRustBuffer {
2751
2833
}
2752
2834
}
2753
2835
2836
+ #if swift(>=5.8)
2837
+ @_documentation ( visibility: private)
2838
+ #endif
2839
+ fileprivate struct FfiConverterOptionTypeFtsMatchInfo : FfiConverterRustBuffer {
2840
+ typealias SwiftType = FtsMatchInfo ?
2841
+
2842
+ public static func write( _ value: SwiftType , into buf: inout [ UInt8 ] ) {
2843
+ guard let value = value else {
2844
+ writeInt ( & buf, Int8 ( 0 ) )
2845
+ return
2846
+ }
2847
+ writeInt ( & buf, Int8 ( 1 ) )
2848
+ FfiConverterTypeFtsMatchInfo . write ( value, into: & buf)
2849
+ }
2850
+
2851
+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> SwiftType {
2852
+ switch try readInt ( & buf) as Int8 {
2853
+ case 0 : return nil
2854
+ case 1 : return try FfiConverterTypeFtsMatchInfo . read ( from: & buf)
2855
+ default : throw UniffiInternalError . unexpectedOptionalTag
2856
+ }
2857
+ }
2858
+ }
2859
+
2754
2860
#if swift(>=5.8)
2755
2861
@_documentation ( visibility: private)
2756
2862
#endif
0 commit comments