[][src]Struct logins::LoginDb

pub struct LoginDb {
    pub db: Connection,
    interrupt_counter: Arc<AtomicUsize>,
}

Fields

db: Connectioninterrupt_counter: Arc<AtomicUsize>

Implementations

impl LoginDb[src]

pub fn with_connection(
    db: Connection,
    encryption_key: Option<&str>,
    salt: Option<&str>
) -> Result<Self>
[src]

pub fn open(
    path: impl AsRef<Path>,
    encryption_key: Option<&str>
) -> Result<Self>
[src]

pub fn open_with_salt(
    path: impl AsRef<Path>,
    encryption_key: &str,
    salt: &str
) -> Result<Self>
[src]

pub fn open_in_memory(encryption_key: Option<&str>) -> Result<Self>[src]

pub fn open_and_get_salt(
    path: impl AsRef<Path>,
    encryption_key: &str
) -> Result<String>
[src]

Opens an existing database and fetches the salt. This method is used by iOS consumers as part as the migration plan to store the salt outside of the sqlite db headers.

Will return an error if the database does not exist.

pub fn open_and_migrate_to_plaintext_header(
    path: impl AsRef<Path>,
    encryption_key: &str,
    salt: &str
) -> Result<()>
[src]

pub fn disable_mem_security(&self) -> Result<()>[src]

pub fn rekey_database(&self, new_encryption_key: &str) -> Result<()>[src]

Change the key on an existing encrypted database, it must first be unlocked with the current encryption key. Once the database is readable and writeable, PRAGMA rekey can be used to re-encrypt every page in the database with a new key. https://www.zetetic.net/sqlcipher/sqlcipher-api/#Changing_Key

pub fn new_interrupt_handle(&self) -> SqlInterruptHandle[src]

pub fn begin_interrupt_scope(&self) -> SqlInterruptScope[src]

impl LoginDb[src]

fn mark_as_synchronized(
    &self,
    guids: &[&str],
    ts: ServerTimestamp,
    scope: &SqlInterruptScope
) -> Result<()>
[src]

fn fetch_login_data(
    &self,
    records: &[(Payload, ServerTimestamp)],
    telem: &mut EngineIncoming,
    scope: &SqlInterruptScope
) -> Result<Vec<SyncLoginData>>
[src]

fn find_dupe(&self, l: &Login) -> Result<Option<Login>>[src]

pub fn get_all(&self) -> Result<Vec<Login>>[src]

pub fn get_by_base_domain(&self, base_domain: &str) -> Result<Vec<Login>>[src]

pub fn get_by_id(&self, id: &str) -> Result<Option<Login>>[src]

pub fn touch(&self, id: &str) -> Result<()>[src]

pub fn add(&self, login: Login) -> Result<Login>[src]

pub fn import_multiple(&self, logins: &[Login]) -> Result<MigrationMetrics>[src]

pub fn update(&self, login: Login) -> Result<()>[src]

pub fn check_valid_with_no_dupes(&self, login: &Login) -> Result<()>[src]

pub fn fixup_and_check_for_dupes(&self, login: Login) -> Result<Login>[src]

pub fn check_for_dupes(&self, login: &Login) -> Result<()>[src]

pub fn dupe_exists(&self, login: &Login) -> Result<bool>[src]

pub fn potential_dupes_ignoring_username(
    &self,
    login: &Login
) -> Result<Vec<Login>>
[src]

pub fn exists(&self, id: &str) -> Result<bool>[src]

pub fn delete(&self, id: &str) -> Result<bool>[src]

Delete the record with the provided id. Returns true if the record existed already.

fn mark_mirror_overridden(&self, guid: &str) -> Result<()>[src]

fn ensure_local_overlay_exists(&self, guid: &str) -> Result<()>[src]

fn clone_mirror_to_overlay(&self, guid: &str) -> Result<usize>[src]

pub fn reset(&self, assoc: &StoreSyncAssociation) -> Result<()>[src]

pub fn wipe(&self, scope: &SqlInterruptScope) -> Result<()>[src]

pub fn wipe_local(&self) -> Result<()>[src]

fn reconcile(
    &self,
    records: Vec<SyncLoginData>,
    server_now: ServerTimestamp,
    telem: &mut EngineIncoming,
    scope: &SqlInterruptScope
) -> Result<UpdatePlan>
[src]

fn execute_plan(
    &self,
    plan: UpdatePlan,
    scope: &SqlInterruptScope
) -> Result<()>
[src]

pub fn fetch_outgoing(
    &self,
    st: ServerTimestamp,
    scope: &SqlInterruptScope
) -> Result<OutgoingChangeset>
[src]

fn do_apply_incoming(
    &self,
    inbound: IncomingChangeset,
    telem: &mut Engine,
    scope: &SqlInterruptScope
) -> Result<OutgoingChangeset>
[src]

fn put_meta(&self, key: &str, value: &dyn ToSql) -> Result<()>[src]

fn get_meta<T: FromSql>(&self, key: &str) -> Result<Option<T>>[src]

fn delete_meta(&self, key: &str) -> Result<()>[src]

fn set_last_sync(&self, last_sync: ServerTimestamp) -> Result<()>[src]

fn get_last_sync(&self) -> Result<Option<ServerTimestamp>>[src]

pub fn set_global_state(&self, state: &Option<String>) -> Result<()>[src]

pub fn get_global_state(&self) -> Result<Option<String>>[src]

pub fn migrate_global_state(&self) -> Result<()>[src]

A utility we can kill by the end of 2019 ;)

Trait Implementations

impl ConnExt for LoginDb[src]

impl Deref for LoginDb[src]

type Target = Connection

The resulting type after dereferencing.

Auto Trait Implementations

impl !RefUnwindSafe for LoginDb

impl Send for LoginDb

impl !Sync for LoginDb

impl Unpin for LoginDb

impl !UnwindSafe for LoginDb

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>,