pub struct PlacesApi { /* private fields */ }
Expand description
The entry-point to the places API. This object gives access to database connections and other helpers. It enforces that only 1 write connection can exist to the database at once.
Implementations§
source§impl PlacesApi
impl PlacesApi
sourcepub fn new(db_name: impl AsRef<Path>) -> Result<Arc<Self>>
pub fn new(db_name: impl AsRef<Path>) -> Result<Arc<Self>>
Create a new, or fetch an already open, PlacesApi backed by a file on disk.
sourcepub fn new_memory(db_name: &str) -> Result<Arc<Self>>
pub fn new_memory(db_name: &str) -> Result<Arc<Self>>
Create a new, or fetch an already open, memory-based PlacesApi. You must provide a name, but you are still able to have a single writer and many reader connections to the same memory DB open.
sourcepub fn open_connection(&self, conn_type: ConnectionType) -> Result<PlacesDb>
pub fn open_connection(&self, conn_type: ConnectionType) -> Result<PlacesDb>
Open a connection to the database.
pub fn get_sync_connection(&self) -> Result<Arc<SharedPlacesDb>>
sourcepub fn close_connection(&self, connection: PlacesDb) -> Result<()>
pub fn close_connection(&self, connection: PlacesDb) -> Result<()>
Close a connection to the database. If the connection is the write connection, you can re-fetch it using open_connection.
pub fn register_with_sync_manager(self: Arc<Self>)
pub fn sync_history( &self, client_init: &Sync15StorageClientInit, key_bundle: &KeyBundle, ) -> Result<SyncTelemetryPing>
pub fn sync_bookmarks( &self, client_init: &Sync15StorageClientInit, key_bundle: &KeyBundle, ) -> Result<SyncTelemetryPing>
pub fn do_sync_one<F>( &self, name: &'static str, syncer: F, ) -> Result<SyncTelemetryPing>
pub fn sync( &self, client_init: &Sync15StorageClientInit, key_bundle: &KeyBundle, ) -> Result<SyncResult>
pub fn wipe_bookmarks(&self) -> Result<()>
pub fn reset_bookmarks(&self) -> Result<()>
pub fn reset_history(&self) -> ApiResult<()>
source§impl PlacesApi
impl PlacesApi
pub fn new_connection( &self, conn_type: ConnectionType, ) -> ApiResult<Arc<PlacesConnection>>
pub fn history_sync( &self, key_id: String, access_token: String, sync_key: String, tokenserver_url: Url, ) -> ApiResult<String>
pub fn bookmarks_sync( &self, key_id: String, access_token: String, sync_key: String, tokenserver_url: Url, ) -> ApiResult<String>
pub fn bookmarks_reset(&self) -> ApiResult<()>
Auto Trait Implementations§
impl !Freeze for PlacesApi
impl !RefUnwindSafe for PlacesApi
impl Send for PlacesApi
impl Sync for PlacesApi
impl Unpin for PlacesApi
impl !UnwindSafe for PlacesApi
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>
Read more