Skip to main content

ExternalBackup

Trait ExternalBackup 

Source
pub trait ExternalBackup: Send + Debug {
    // Required methods
    fn store(&self, key: String, value: String);
    fn load(&self, key: String) -> Option<String>;
    fn clear(&self, key: String);
    fn clear_all(&self);
    fn should_apply_stored_client_id(&self) -> bool;
}
Expand description

Embedders may optionally supply an object that implements this interface to provide external backup storage for Glean internal data.

Required Methods§

Source

fn store(&self, key: String, value: String)

Store value under the key key.

Source

fn load(&self, key: String) -> Option<String>

Retrieve the most recent value stored for key. Returns nothing if there is no value.

Source

fn clear(&self, key: String)

Clear the stored value for key.

Source

fn clear_all(&self)

Clear all values for all keys previously stored.

Source

fn should_apply_stored_client_id(&self) -> bool

TEMPORARY ONLY FOR A LITTLE WHILE Should we actually use the value for the client_id we asked for ( if there even is one )?

Trait Implementations§

Source§

impl<UT> LiftRef<UT> for Box<dyn ExternalBackup>

Source§

impl<UT> LiftReturn<UT> for Box<dyn ExternalBackup>

Source§

type ReturnType = <Box<dyn ExternalBackup> as Lift<UT>>::FfiType

FFI return type for trait interfaces
Source§

fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>

Lift a successfully returned value from a trait interface
§

fn lift_foreign_return( ffi_return: Self::ReturnType, call_status: RustCallStatus, ) -> Self

Lift a foreign returned value from a trait interface Read more
§

fn lift_error(_buf: RustBuffer) -> Self

Lift a Rust value for a callback interface method error result Read more
§

fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self

Lift a Rust value for an unexpected callback interface error Read more
Source§

impl MallocSizeOf for dyn ExternalBackup

Source§

fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself.

Implementors§