pub struct RemoteSettingsService { /* private fields */ }
Expand description
Application-level Remote Settings manager.
This handles application-level operations, like syncing all the collections, and acts as a factory for creating clients.
Implementations§
Source§impl RemoteSettingsService
impl RemoteSettingsService
Sourcepub fn new(storage_dir: String, config: RemoteSettingsConfig2) -> Self
pub fn new(storage_dir: String, config: RemoteSettingsConfig2) -> Self
Construct a RemoteSettingsService
This is typically done early in the application-startup process.
This method performs no IO or network requests and is safe to run in a main thread that can’t be blocked.
storage_dir
is a directory to store SQLite files in – one per collection. If the
directory does not exist, it will be created when the storage is first used. Only the
directory and the SQLite files will be created, any parent directories must already exist.
Sourcepub fn make_client(&self, collection_name: String) -> Arc<RemoteSettingsClient>
pub fn make_client(&self, collection_name: String) -> Arc<RemoteSettingsClient>
Create a new Remote Settings client
This method performs no IO or network requests and is safe to run in a main thread that can’t be blocked.
Sourcepub fn update_config(&self, config: RemoteSettingsConfig2) -> ApiResult<()>
pub fn update_config(&self, config: RemoteSettingsConfig2) -> ApiResult<()>
Update the remote settings config
This will cause all current and future clients to use new config and will delete any stored records causing the clients to return new results from the new config.
Only intended for QA/debugging. Swapping the remote settings server in the middle of execution can cause weird effects.
Trait Implementations§
Source§impl<UT> LiftRef<UT> for RemoteSettingsService
impl<UT> LiftRef<UT> for RemoteSettingsService
type LiftType = Arc<RemoteSettingsService>
Source§impl<UT> LowerError<UT> for RemoteSettingsService
impl<UT> LowerError<UT> for RemoteSettingsService
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for RemoteSettingsService
impl<UT> LowerReturn<UT> for RemoteSettingsService
Source§type ReturnType = <Arc<RemoteSettingsService> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<RemoteSettingsService> as LowerReturn<UniFfiTag>>::ReturnType
Source§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>
Source§impl<UT> TypeId<UT> for RemoteSettingsService
impl<UT> TypeId<UT> for RemoteSettingsService
const TYPE_ID_META: MetadataBuffer = _
Auto Trait Implementations§
impl !Freeze for RemoteSettingsService
impl !RefUnwindSafe for RemoteSettingsService
impl Send for RemoteSettingsService
impl Sync for RemoteSettingsService
impl Unpin for RemoteSettingsService
impl !UnwindSafe for RemoteSettingsService
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