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§
sourcefn collection_url(&self) -> String
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
sourcefn get_records(
&mut self,
timestamp: Option<u64>,
) -> Result<Vec<RemoteSettingsRecord>>
fn get_records( &mut self, timestamp: Option<u64>, ) -> Result<Vec<RemoteSettingsRecord>>
Fetch records from the server
sourcefn get_attachment(&mut self, attachment_location: &str) -> Result<Vec<u8>>
fn get_attachment(&mut self, attachment_location: &str) -> Result<Vec<u8>>
Fetch an attachment from the server
sourcefn is_prod_server(&self) -> Result<bool>
fn is_prod_server(&self) -> Result<bool>
Check if this client is pointing to the production server