[][src]Struct places::api::places_api::PlacesApi

pub struct PlacesApi {
    db_name: PathBuf,
    write_connection: Mutex<Option<PlacesDb>>,
    sync_state: Mutex<Option<SyncState>>,
    coop_tx_lock: Arc<Mutex<()>>,
    sync_conn_active: AtomicBool,
    id: usize,
}

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: PathBufwrite_connection: Mutex<Option<PlacesDb>>sync_state: Mutex<Option<SyncState>>coop_tx_lock: Arc<Mutex<()>>sync_conn_active: AtomicBoolid: 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]

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]

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

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

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]

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

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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