[−][src]Trait dogear::Driver
A merge driver provides methods to customize merging behavior.
Provided methods
fn generate_new_guid(&self, invalid_guid: &Guid) -> Result<Guid>
Generates a new GUID for the given invalid GUID. This is used to fix up items with GUIDs that Places can't store (bug 1380606, bug 1313026).
The default implementation returns an error, forbidding invalid GUIDs.
Implementations of Driver
can either use the rand
and base64
crates to generate a new, random GUID (9 bytes, Base64url-encoded
without padding), or use an existing method like Desktop's
nsINavHistoryService::MakeGuid
. Dogear doesn't generate new GUIDs
automatically to avoid depending on those crates.
Implementations can also return Ok(invalid_guid.clone())
to pass
through all invalid GUIDs, as the tests do.
fn max_log_level(&self) -> LevelFilter
Returns the maximum log level for merge messages. The default
implementation returns the log
crate's global maximum level.
fn logger(&self) -> &dyn Log
Returns a logger for merge messages.
The default implementation returns the log
crate's global logger.
Implementations can override this method to return a custom logger,
where using the global logger won't work. For example, Firefox Desktop
has an existing Sync logging setup outside of the log
crate.
fn record_telemetry_event(&self, _: TelemetryEvent)
Records a merge telemetry event.
The default implementation is a no-op that discards the event. Implementations can override this method to capture event and bookmark validation telemetry.