Struct places::api::places_api::PlacesApi

source ·
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

source

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.

source

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.

source

pub fn open_connection(&self, conn_type: ConnectionType) -> Result<PlacesDb>

Open a connection to the database.

source

pub fn get_sync_connection(&self) -> Result<Arc<SharedPlacesDb>>

source

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.

source

pub fn register_with_sync_manager(self: Arc<Self>)

source

pub fn sync_history( &self, client_init: &Sync15StorageClientInit, key_bundle: &KeyBundle ) -> Result<SyncTelemetryPing>

source

pub fn sync_bookmarks( &self, client_init: &Sync15StorageClientInit, key_bundle: &KeyBundle ) -> Result<SyncTelemetryPing>

source

pub fn do_sync_one<F>( &self, name: &'static str, syncer: F ) -> Result<SyncTelemetryPing>
where F: FnOnce(Arc<SharedPlacesDb>, &mut MemoryCachedState, &mut Option<String>) -> Result<SyncResult>,

source

pub fn sync( &self, client_init: &Sync15StorageClientInit, key_bundle: &KeyBundle ) -> Result<SyncResult>

source

pub fn wipe_bookmarks(&self) -> Result<()>

source

pub fn reset_bookmarks(&self) -> Result<()>

source

pub fn reset_history(&self) -> ApiResult<()>

source§

impl PlacesApi

source

pub fn new_connection( &self, conn_type: ConnectionType ) -> ApiResult<Arc<PlacesConnection>>

source

pub fn history_sync( &self, key_id: String, access_token: String, sync_key: String, tokenserver_url: Url ) -> ApiResult<String>

source

pub fn bookmarks_sync( &self, key_id: String, access_token: String, sync_key: String, tokenserver_url: Url ) -> ApiResult<String>

source

pub fn bookmarks_reset(&self) -> ApiResult<()>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
§

unsafe fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<> Read more
§

unsafe fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V