[−][src]Struct places::api::places_api::PlacesApi
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.
Fields
db_name: PathBuf
write_connection: Mutex<Option<PlacesDb>>
sync_state: Mutex<Option<SyncState>>
coop_tx_lock: Arc<Mutex<()>>
sync_conn_active: AtomicBool
id: usize
Implementations
impl PlacesApi
[src]
pub fn new(db_name: impl AsRef<Path>) -> Result<Arc<Self>>
[src]
Create a new, or fetch an already open, PlacesApi backed by a file on disk.
pub fn new_memory(db_name: &str) -> Result<Arc<Self>>
[src]
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.
fn new_or_existing_into(
target: &mut HashMap<PathBuf, Weak<PlacesApi>>,
db_name: PathBuf,
delete_on_fail: bool
) -> Result<Arc<Self>>
[src]
target: &mut HashMap<PathBuf, Weak<PlacesApi>>,
db_name: PathBuf,
delete_on_fail: bool
) -> Result<Arc<Self>>
fn new_or_existing(db_name: PathBuf) -> Result<Arc<Self>>
[src]
pub fn open_connection(&self, conn_type: ConnectionType) -> Result<PlacesDb>
[src]
Open a connection to the database.
pub fn open_sync_connection(&self) -> Result<SyncConn<'_>>
[src]
pub fn close_connection(&self, connection: PlacesDb) -> Result<()>
[src]
Close a connection to the database. If the connection is the write connection, you can re-fetch it using open_connection.
fn get_disk_persisted_state(&self, conn: &PlacesDb) -> Result<Option<String>>
[src]
fn set_disk_persisted_state(
&self,
conn: &PlacesDb,
state: &Option<String>
) -> Result<()>
[src]
&self,
conn: &PlacesDb,
state: &Option<String>
) -> Result<()>
pub fn sync_history(
&self,
client_init: &Sync15StorageClientInit,
key_bundle: &KeyBundle
) -> Result<SyncTelemetryPing>
[src]
&self,
client_init: &Sync15StorageClientInit,
key_bundle: &KeyBundle
) -> Result<SyncTelemetryPing>
pub fn sync_bookmarks(
&self,
client_init: &Sync15StorageClientInit,
key_bundle: &KeyBundle
) -> Result<SyncTelemetryPing>
[src]
&self,
client_init: &Sync15StorageClientInit,
key_bundle: &KeyBundle
) -> Result<SyncTelemetryPing>
pub fn do_sync_one<F>(
&self,
name: &'static str,
syncer: F
) -> Result<SyncTelemetryPing> where
F: FnOnce(&SyncConn<'_>, &mut MemoryCachedState, &mut Option<String>) -> SyncResult,
[src]
&self,
name: &'static str,
syncer: F
) -> Result<SyncTelemetryPing> where
F: FnOnce(&SyncConn<'_>, &mut MemoryCachedState, &mut Option<String>) -> SyncResult,
pub fn sync(
&self,
client_init: &Sync15StorageClientInit,
key_bundle: &KeyBundle
) -> Result<SyncResult>
[src]
&self,
client_init: &Sync15StorageClientInit,
key_bundle: &KeyBundle
) -> Result<SyncResult>
pub fn wipe_bookmarks(&self) -> Result<()>
[src]
pub fn reset_bookmarks(&self) -> Result<()>
[src]
pub fn wipe_history(&self) -> Result<()>
[src]
pub fn reset_history(&self) -> Result<()>
[src]
pub fn new_sync_conn_interrupt_handle(&self) -> Result<SqlInterruptHandle>
[src]
Get a new interrupt handle for the sync connection.
Auto Trait Implementations
impl RefUnwindSafe for PlacesApi
impl Send for PlacesApi
impl Sync for PlacesApi
impl Unpin for PlacesApi
impl UnwindSafe for PlacesApi
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,