@@ -789,7 +789,7 @@ public protocol PlacesConnectionProtocol : AnyObject {
789
789
790
790
func newInterruptHandle( ) -> SqlInterruptHandle
791
791
792
- func noteHistoryMetadataObservation( data: HistoryMetadataObservation ) throws
792
+ func noteHistoryMetadataObservation( data: HistoryMetadataObservation , options : NoteHistoryMetadataObservationOptions ) throws
793
793
794
794
func placesHistoryImportFromIos( dbPath: String , lastSyncTimestamp: Int64 ) throws -> HistoryMigrationResult
795
795
@@ -1165,9 +1165,10 @@ open func newInterruptHandle() -> SqlInterruptHandle {
1165
1165
} )
1166
1166
}
1167
1167
1168
- open func noteHistoryMetadataObservation( data: HistoryMetadataObservation ) throws { try rustCallWithError ( FfiConverterTypePlacesApiError . lift) {
1168
+ open func noteHistoryMetadataObservation( data: HistoryMetadataObservation , options : NoteHistoryMetadataObservationOptions ) throws { try rustCallWithError ( FfiConverterTypePlacesApiError . lift) {
1169
1169
uniffi_places_fn_method_placesconnection_note_history_metadata_observation ( self . uniffiClonePointer ( ) ,
1170
- FfiConverterTypeHistoryMetadataObservation . lower ( data) , $0
1170
+ FfiConverterTypeHistoryMetadataObservation . lower ( data) ,
1171
+ FfiConverterTypeNoteHistoryMetadataObservationOptions . lower ( options) , $0
1171
1172
)
1172
1173
}
1173
1174
}
@@ -2843,6 +2844,67 @@ public func FfiConverterTypeInsertableBookmarkSeparator_lower(_ value: Insertabl
2843
2844
}
2844
2845
2845
2846
2847
+ /**
2848
+ * Options for recording history metadata observations.
2849
+ */
2850
+ public struct NoteHistoryMetadataObservationOptions {
2851
+ public var ifPageMissing : HistoryMetadataPageMissingBehavior
2852
+
2853
+ // Default memberwise initializers are never public by default, so we
2854
+ // declare one manually.
2855
+ public init ( ifPageMissing: HistoryMetadataPageMissingBehavior = . ignoreObservation) {
2856
+ self . ifPageMissing = ifPageMissing
2857
+ }
2858
+ }
2859
+
2860
+
2861
+
2862
+ extension NoteHistoryMetadataObservationOptions : Equatable , Hashable {
2863
+ public static func == ( lhs: NoteHistoryMetadataObservationOptions , rhs: NoteHistoryMetadataObservationOptions ) -> Bool {
2864
+ if lhs. ifPageMissing != rhs. ifPageMissing {
2865
+ return false
2866
+ }
2867
+ return true
2868
+ }
2869
+
2870
+ public func hash( into hasher: inout Hasher ) {
2871
+ hasher. combine ( ifPageMissing)
2872
+ }
2873
+ }
2874
+
2875
+
2876
+ #if swift(>=5.8)
2877
+ @_documentation ( visibility: private)
2878
+ #endif
2879
+ public struct FfiConverterTypeNoteHistoryMetadataObservationOptions : FfiConverterRustBuffer {
2880
+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> NoteHistoryMetadataObservationOptions {
2881
+ return
2882
+ try NoteHistoryMetadataObservationOptions (
2883
+ ifPageMissing: FfiConverterTypeHistoryMetadataPageMissingBehavior . read ( from: & buf)
2884
+ )
2885
+ }
2886
+
2887
+ public static func write( _ value: NoteHistoryMetadataObservationOptions , into buf: inout [ UInt8 ] ) {
2888
+ FfiConverterTypeHistoryMetadataPageMissingBehavior . write ( value. ifPageMissing, into: & buf)
2889
+ }
2890
+ }
2891
+
2892
+
2893
+ #if swift(>=5.8)
2894
+ @_documentation ( visibility: private)
2895
+ #endif
2896
+ public func FfiConverterTypeNoteHistoryMetadataObservationOptions_lift( _ buf: RustBuffer ) throws -> NoteHistoryMetadataObservationOptions {
2897
+ return try FfiConverterTypeNoteHistoryMetadataObservationOptions . lift ( buf)
2898
+ }
2899
+
2900
+ #if swift(>=5.8)
2901
+ @_documentation ( visibility: private)
2902
+ #endif
2903
+ public func FfiConverterTypeNoteHistoryMetadataObservationOptions_lower( _ value: NoteHistoryMetadataObservationOptions ) -> RustBuffer {
2904
+ return FfiConverterTypeNoteHistoryMetadataObservationOptions . lower ( value)
2905
+ }
2906
+
2907
+
2846
2908
public struct RunMaintenanceMetrics {
2847
2909
public var prunedVisits : Bool
2848
2910
public var dbSizeBefore : UInt32
@@ -3555,6 +3617,80 @@ extension FrecencyThresholdOption: Equatable, Hashable {}
3555
3617
3556
3618
3557
3619
3620
+ // Note that we don't yet support `indirect` for enums.
3621
+ // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
3622
+ /**
3623
+ * The action to take when recording a history metadata observation for
3624
+ * a page that doesn't have an entry in the history database.
3625
+ */
3626
+
3627
+ public enum HistoryMetadataPageMissingBehavior {
3628
+
3629
+ /**
3630
+ * Insert an entry for the page into the history database.
3631
+ */
3632
+ case insertPage
3633
+ /**
3634
+ * Ignore and discard the observation. This is the default behavior.
3635
+ */
3636
+ case ignoreObservation
3637
+ }
3638
+
3639
+
3640
+ #if swift(>=5.8)
3641
+ @_documentation ( visibility: private)
3642
+ #endif
3643
+ public struct FfiConverterTypeHistoryMetadataPageMissingBehavior : FfiConverterRustBuffer {
3644
+ typealias SwiftType = HistoryMetadataPageMissingBehavior
3645
+
3646
+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> HistoryMetadataPageMissingBehavior {
3647
+ let variant : Int32 = try readInt ( & buf)
3648
+ switch variant {
3649
+
3650
+ case 1 : return . insertPage
3651
+
3652
+ case 2 : return . ignoreObservation
3653
+
3654
+ default : throw UniffiInternalError . unexpectedEnumCase
3655
+ }
3656
+ }
3657
+
3658
+ public static func write( _ value: HistoryMetadataPageMissingBehavior , into buf: inout [ UInt8 ] ) {
3659
+ switch value {
3660
+
3661
+
3662
+ case . insertPage:
3663
+ writeInt ( & buf, Int32 ( 1 ) )
3664
+
3665
+
3666
+ case . ignoreObservation:
3667
+ writeInt ( & buf, Int32 ( 2 ) )
3668
+
3669
+ }
3670
+ }
3671
+ }
3672
+
3673
+
3674
+ #if swift(>=5.8)
3675
+ @_documentation ( visibility: private)
3676
+ #endif
3677
+ public func FfiConverterTypeHistoryMetadataPageMissingBehavior_lift( _ buf: RustBuffer ) throws -> HistoryMetadataPageMissingBehavior {
3678
+ return try FfiConverterTypeHistoryMetadataPageMissingBehavior . lift ( buf)
3679
+ }
3680
+
3681
+ #if swift(>=5.8)
3682
+ @_documentation ( visibility: private)
3683
+ #endif
3684
+ public func FfiConverterTypeHistoryMetadataPageMissingBehavior_lower( _ value: HistoryMetadataPageMissingBehavior ) -> RustBuffer {
3685
+ return FfiConverterTypeHistoryMetadataPageMissingBehavior . lower ( value)
3686
+ }
3687
+
3688
+
3689
+
3690
+ extension HistoryMetadataPageMissingBehavior : Equatable , Hashable { }
3691
+
3692
+
3693
+
3558
3694
// Note that we don't yet support `indirect` for enums.
3559
3695
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
3560
3696
@@ -4792,7 +4928,7 @@ private var initializationResult: InitializationResult = {
4792
4928
if ( uniffi_places_checksum_method_placesconnection_new_interrupt_handle ( ) != 5418 ) {
4793
4929
return InitializationResult . apiChecksumMismatch
4794
4930
}
4795
- if ( uniffi_places_checksum_method_placesconnection_note_history_metadata_observation ( ) != 12555 ) {
4931
+ if ( uniffi_places_checksum_method_placesconnection_note_history_metadata_observation ( ) != 31493 ) {
4796
4932
return InitializationResult . apiChecksumMismatch
4797
4933
}
4798
4934
if ( uniffi_places_checksum_method_placesconnection_places_history_import_from_ios ( ) != 596 ) {
0 commit comments