remote_settings::client

Trait ApiClient

source
pub trait ApiClient {
    // Required methods
    fn collection_url(&self) -> String;
    fn get_records(
        &mut self,
        timestamp: Option<u64>,
    ) -> Result<Vec<RemoteSettingsRecord>>;
    fn get_attachment(&mut self, attachment_location: &str) -> Result<Vec<u8>>;
    fn is_prod_server(&self) -> Result<bool>;
}

Required Methods§

source

fn collection_url(&self) -> String

Get the Bucket URL for this client.

This is a URL that includes the server URL, bucket name, and collection name. This is used to check if the application has switched the remote settings config and therefore we should throw away any cached data

Returns it as a String, since that’s what the storage expects

source

fn get_records( &mut self, timestamp: Option<u64>, ) -> Result<Vec<RemoteSettingsRecord>>

Fetch records from the server

source

fn get_attachment(&mut self, attachment_location: &str) -> Result<Vec<u8>>

Fetch an attachment from the server

source

fn is_prod_server(&self) -> Result<bool>

Check if this client is pointing to the production server

Implementors§