nimbus/
lib.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
5extern crate core;
6
7mod defaults;
8mod enrollment;
9mod evaluator;
10mod json;
11mod sampling;
12mod strings;
13mod targeting;
14
15pub mod error;
16pub mod metrics;
17pub mod schema;
18
19pub use enrollment::{EnrolledFeature, EnrollmentStatus};
20pub use error::{NimbusError, Result};
21#[cfg(debug_assertions)]
22pub use evaluator::evaluate_enrollment;
23pub use schema::*;
24pub use targeting::NimbusTargetingHelper;
25
26cfg_if::cfg_if! {
27    if #[cfg(feature = "stateful")] {
28
29        pub mod stateful;
30
31        pub use stateful::nimbus_client::*;
32        pub use stateful::matcher::AppContext;
33        pub use remote_settings::{RemoteSettingsConfig, RemoteSettingsServer};
34    } else {
35        pub mod stateless;
36
37        pub use stateless::cirrus_client::*;
38        pub use stateless::matcher::AppContext;
39    }
40}
41
42// Exposed for Example only
43pub use evaluator::TargetingAttributes;
44
45pub(crate) const SLUG_REPLACEMENT_PATTERN: &str = "{experiment}";
46
47#[cfg(test)]
48mod tests;