pub struct Store { /* private fields */ }Implementations§
Source§impl Store
impl Store
pub fn new(db_path: impl AsRef<Path>) -> ApiResult<Self>
Creates a store backed by an in-memory database that shares its memory API (required for autofill sync tests).
pub fn add_credit_card( &self, fields: UpdatableCreditCardFields, ) -> ApiResult<CreditCard>
pub fn get_credit_card(&self, guid: String) -> ApiResult<CreditCard>
pub fn get_all_credit_cards(&self) -> ApiResult<Vec<CreditCard>>
pub fn count_all_credit_cards(&self) -> ApiResult<i64>
pub fn update_credit_card( &self, guid: String, credit_card: UpdatableCreditCardFields, ) -> ApiResult<()>
pub fn delete_credit_card(&self, guid: String) -> ApiResult<bool>
pub fn touch_credit_card(&self, guid: String) -> ApiResult<()>
pub fn add_address( &self, new_address: UpdatableAddressFields, ) -> ApiResult<Address>
Sourcepub fn add_address_with_meta(
&self,
entry_with_meta: UpdatableAddressFieldsWithMeta,
) -> ApiResult<Address>
pub fn add_address_with_meta( &self, entry_with_meta: UpdatableAddressFieldsWithMeta, ) -> ApiResult<Address>
Adds an address including metadata. Normally you will use
add_address instead, and the metadata (guid, timestamps, change counter)
will be taken care of here. However, in some cases this method is
necessary, for example when migrating data from another store that
already contains the metadata.
Sourcepub fn add_many_addresses_with_meta(
&self,
entries_with_meta: Vec<UpdatableAddressFieldsWithMeta>,
) -> ApiResult<Vec<AddressBulkResultEntry>>
pub fn add_many_addresses_with_meta( &self, entries_with_meta: Vec<UpdatableAddressFieldsWithMeta>, ) -> ApiResult<Vec<AddressBulkResultEntry>>
Adds multiple addresses including metadata, with a result per record.
Sourcepub fn add_many_address_tombstones(
&self,
tombstones: Vec<AddressTombstone>,
) -> ApiResult<Vec<AddressBulkTombstoneResultEntry>>
pub fn add_many_address_tombstones( &self, tombstones: Vec<AddressTombstone>, ) -> ApiResult<Vec<AddressBulkTombstoneResultEntry>>
Adds tombstones for addresses whose deletion has not yet been uploaded, with a result per record.
Sourcepub fn delete_all_addresses(&self) -> ApiResult<()>
pub fn delete_all_addresses(&self) -> ApiResult<()>
Removes every address and every address tombstone.
pub fn get_address(&self, guid: String) -> ApiResult<Address>
pub fn get_all_addresses(&self) -> ApiResult<Vec<Address>>
pub fn count_all_addresses(&self) -> ApiResult<i64>
pub fn update_address( &self, guid: String, address: UpdatableAddressFields, ) -> ApiResult<()>
Sourcepub fn update_address_with_meta(
&self,
entry_with_meta: UpdatableAddressFieldsWithMeta,
) -> ApiResult<()>
pub fn update_address_with_meta( &self, entry_with_meta: UpdatableAddressFieldsWithMeta, ) -> ApiResult<()>
Updates an address including metadata, setting both its fields and
its timestamps and times_used to the supplied values. Normally you will
use update_address instead, which leaves time_last_modified to this
store; this is for keeping a record identical to one held elsewhere.
Errors with NoSuchRecord if the guid is absent.
pub fn delete_address(&self, guid: String) -> ApiResult<bool>
pub fn touch_address(&self, guid: String) -> ApiResult<()>
pub fn add_passport( &self, fields: UpdatablePassportFields, ) -> ApiResult<Passport>
pub fn get_passport(&self, guid: String) -> ApiResult<Passport>
pub fn get_all_passports(&self) -> ApiResult<Vec<Passport>>
pub fn count_all_passports(&self) -> ApiResult<i64>
pub fn update_passport( &self, guid: String, passport: UpdatablePassportFields, ) -> ApiResult<()>
pub fn delete_passport(&self, guid: String) -> ApiResult<bool>
pub fn touch_passport(&self, guid: String) -> ApiResult<()>
pub fn scrub_encrypted_data(self: Arc<Self>) -> ApiResult<()>
pub fn scrub_undecryptable_credit_card_data_for_remote_replacement( self: Arc<Self>, local_encryption_key: String, ) -> ApiResult<CreditCardsDeletionMetrics>
pub fn run_maintenance(&self) -> ApiResult<()>
pub fn shutdown(&self)
pub fn register_with_sync_manager(self: Arc<Self>)
pub fn create_credit_cards_sync_engine(self: Arc<Self>) -> Box<dyn SyncEngine>
pub fn create_addresses_sync_engine(self: Arc<Self>) -> Box<dyn SyncEngine>
Source§impl Store
impl Store
Sourcepub fn addresses_bridged_engine(self: Arc<Self>) -> Arc<AddressesBridgedEngine>
pub fn addresses_bridged_engine(self: Arc<Self>) -> Arc<AddressesBridgedEngine>
Returns a bridged sync engine for addresses, for use by Desktop’s Sync
framework. Constructing a ConfigSyncEngine only assembles structs and
never touches the DB, so this cannot fail.
Trait Implementations§
§impl<UT> LowerError<UT> for Store
impl<UT> LowerError<UT> for Store
§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
§impl<UT> LowerReturn<UT> for Store
impl<UT> LowerReturn<UT> for Store
§type ReturnType = <Arc<Store> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<Store> as LowerReturn<UniFfiTag>>::ReturnType
§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
§impl<UT> TypeId<UT> for Store
impl<UT> TypeId<UT> for Store
const TYPE_ID_META: MetadataBuffer
Auto Trait Implementations§
impl !Freeze for Store
impl !RefUnwindSafe for Store
impl Send for Store
impl Sync for Store
impl Unpin for Store
impl !UnwindSafe for Store
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
§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
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read more