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<()>
Trait Implementations§
§impl<UT> LowerError<UT> for PlacesApi
impl<UT> LowerError<UT> for PlacesApi
§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Lower this value for scaffolding function return Read more
§impl<UT> LowerReturn<UT> for PlacesApi
impl<UT> LowerReturn<UT> for PlacesApi
§type ReturnType = <Arc<PlacesApi> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<PlacesApi> as LowerReturn<UniFfiTag>>::ReturnType
The type that should be returned by scaffolding functions for this type. Read more
§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
Lower the return value from an scaffolding call Read more
§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Lower the return value for failed argument lifts Read more
§impl<UT> TypeId<UT> for PlacesApi
impl<UT> TypeId<UT> for PlacesApi
const TYPE_ID_META: MetadataBuffer
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