pub struct RemoteSettingsClient<C = ViaductApiClient> { /* private fields */ }
Expand description
Internal Remote settings client API
This stores an ApiClient implementation. In the real-world, this is always ViaductApiClient, but the tests use a mock client.
Implementations§
source§impl<C: ApiClient> RemoteSettingsClient<C>
impl<C: ApiClient> RemoteSettingsClient<C>
pub fn new_from_parts( collection_name: String, storage: Storage, jexl_filter: JexlFilter, api_client: C, ) -> Self
pub fn collection_name(&self) -> &str
sourcepub fn get_records(
&self,
sync_if_empty: bool,
) -> Result<Option<Vec<RemoteSettingsRecord>>>
pub fn get_records( &self, sync_if_empty: bool, ) -> Result<Option<Vec<RemoteSettingsRecord>>>
Get the current set of records.
If records are not present in storage this will normally return None. Use sync_if_empty = true
to change this behavior and perform a network request in this case.
pub fn sync(&self) -> Result<()>
sourcepub fn get_attachment(&self, record: RemoteSettingsRecord) -> Result<Vec<u8>>
pub fn get_attachment(&self, record: RemoteSettingsRecord) -> Result<Vec<u8>>
Downloads an attachment from [attachment_location]. NOTE: there are no guarantees about a maximum size, so use care when fetching potentially large attachments.
Auto Trait Implementations§
impl<C = ViaductApiClient> !Freeze for RemoteSettingsClient<C>
impl<C = ViaductApiClient> !RefUnwindSafe for RemoteSettingsClient<C>
impl<C> Send for RemoteSettingsClient<C>where
C: Send,
impl<C> Sync for RemoteSettingsClient<C>where
C: Send,
impl<C> Unpin for RemoteSettingsClient<C>where
C: Unpin,
impl<C = ViaductApiClient> !UnwindSafe for RemoteSettingsClient<C>
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
Mutably borrows from an owned value. Read more
§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
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>
Read more