nimbus/stateful/client/null_client.rs
1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5use crate::error::Result;
6use crate::stateful::client::{Experiment, SettingsClient};
7
8/// This is a client for use when no server is provided.
9/// Its primary use is for non-Mozilla forks of apps that are not using their
10/// own server infrastructure.
11pub struct NullClient;
12
13impl NullClient {
14 pub fn new() -> Self {
15 NullClient
16 }
17}
18
19impl SettingsClient for NullClient {
20 fn get_experiments_metadata(&self) -> Result<String> {
21 unimplemented!();
22 }
23 fn fetch_experiments(&self) -> Result<Vec<Experiment>> {
24 Ok(Default::default())
25 }
26}