@@ -332,6 +332,19 @@ fileprivate struct FfiConverterInt64: FfiConverterPrimitive {
332
332
}
333
333
}
334
334
335
+ fileprivate struct FfiConverterDouble : FfiConverterPrimitive {
336
+ typealias FfiType = Double
337
+ typealias SwiftType = Double
338
+
339
+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> Double {
340
+ return try lift ( readDouble ( & buf) )
341
+ }
342
+
343
+ public static func write( _ value: Double , into buf: inout [ UInt8 ] ) {
344
+ writeDouble ( & buf, lower ( value) )
345
+ }
346
+ }
347
+
335
348
fileprivate struct FfiConverterBool : FfiConverter {
336
349
typealias FfiType = Int8
337
350
typealias SwiftType = Bool
@@ -669,6 +682,7 @@ public enum Suggestion {
669
682
670
683
case `amp`( `title`: String , `url`: String , `rawUrl`: String , `icon`: [ UInt8 ] ? , `fullKeyword`: String , `blockId`: Int64 , `advertiser`: String , `iabCategory`: String , `impressionUrl`: String , `clickUrl`: String , `rawClickUrl`: String )
671
684
case `wikipedia`( `title`: String , `url`: String , `icon`: [ UInt8 ] ? , `fullKeyword`: String )
685
+ case `amo`( `title`: String , `url`: String , `iconUrl`: String , `description`: String , `rating`: String ? , `numberOfRatings`: Int64 , `guid`: String , `score`: Double )
672
686
}
673
687
674
688
public struct FfiConverterTypeSuggestion : FfiConverterRustBuffer {
@@ -699,6 +713,17 @@ public struct FfiConverterTypeSuggestion: FfiConverterRustBuffer {
699
713
`fullKeyword`: try FfiConverterString . read ( from: & buf)
700
714
)
701
715
716
+ case 3 : return . `amo`(
717
+ `title`: try FfiConverterString . read ( from: & buf) ,
718
+ `url`: try FfiConverterString . read ( from: & buf) ,
719
+ `iconUrl`: try FfiConverterString . read ( from: & buf) ,
720
+ `description`: try FfiConverterString . read ( from: & buf) ,
721
+ `rating`: try FfiConverterOptionString . read ( from: & buf) ,
722
+ `numberOfRatings`: try FfiConverterInt64 . read ( from: & buf) ,
723
+ `guid`: try FfiConverterString . read ( from: & buf) ,
724
+ `score`: try FfiConverterDouble . read ( from: & buf)
725
+ )
726
+
702
727
default : throw UniffiInternalError . unexpectedEnumCase
703
728
}
704
729
}
@@ -729,6 +754,18 @@ public struct FfiConverterTypeSuggestion: FfiConverterRustBuffer {
729
754
FfiConverterOptionSequenceUInt8 . write ( `icon`, into: & buf)
730
755
FfiConverterString . write ( `fullKeyword`, into: & buf)
731
756
757
+
758
+ case let . `amo`( `title`, `url`, `iconUrl`, `description`, `rating`, `numberOfRatings`, `guid`, `score`) :
759
+ writeInt ( & buf, Int32 ( 3 ) )
760
+ FfiConverterString . write ( `title`, into: & buf)
761
+ FfiConverterString . write ( `url`, into: & buf)
762
+ FfiConverterString . write ( `iconUrl`, into: & buf)
763
+ FfiConverterString . write ( `description`, into: & buf)
764
+ FfiConverterOptionString . write ( `rating`, into: & buf)
765
+ FfiConverterInt64 . write ( `numberOfRatings`, into: & buf)
766
+ FfiConverterString . write ( `guid`, into: & buf)
767
+ FfiConverterDouble . write ( `score`, into: & buf)
768
+
732
769
}
733
770
}
734
771
}
@@ -753,6 +790,7 @@ public enum SuggestionProvider {
753
790
754
791
case `amp`
755
792
case `wikipedia`
793
+ case `amo`
756
794
}
757
795
758
796
public struct FfiConverterTypeSuggestionProvider : FfiConverterRustBuffer {
@@ -766,6 +804,8 @@ public struct FfiConverterTypeSuggestionProvider: FfiConverterRustBuffer {
766
804
767
805
case 2 : return . `wikipedia`
768
806
807
+ case 3 : return . `amo`
808
+
769
809
default : throw UniffiInternalError . unexpectedEnumCase
770
810
}
771
811
}
@@ -781,6 +821,10 @@ public struct FfiConverterTypeSuggestionProvider: FfiConverterRustBuffer {
781
821
case . `wikipedia`:
782
822
writeInt ( & buf, Int32 ( 2 ) )
783
823
824
+
825
+ case . `amo`:
826
+ writeInt ( & buf, Int32 ( 3 ) )
827
+
784
828
}
785
829
}
786
830
}
@@ -820,6 +864,27 @@ fileprivate struct FfiConverterOptionUInt64: FfiConverterRustBuffer {
820
864
}
821
865
}
822
866
867
+ fileprivate struct FfiConverterOptionString : FfiConverterRustBuffer {
868
+ typealias SwiftType = String ?
869
+
870
+ public static func write( _ value: SwiftType , into buf: inout [ UInt8 ] ) {
871
+ guard let value = value else {
872
+ writeInt ( & buf, Int8 ( 0 ) )
873
+ return
874
+ }
875
+ writeInt ( & buf, Int8 ( 1 ) )
876
+ FfiConverterString . write ( value, into: & buf)
877
+ }
878
+
879
+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> SwiftType {
880
+ switch try readInt ( & buf) as Int8 {
881
+ case 0 : return nil
882
+ case 1 : return try FfiConverterString . read ( from: & buf)
883
+ default : throw UniffiInternalError . unexpectedOptionalTag
884
+ }
885
+ }
886
+ }
887
+
823
888
fileprivate struct FfiConverterOptionSequenceUInt8 : FfiConverterRustBuffer {
824
889
typealias SwiftType = [ UInt8 ] ?
825
890
0 commit comments