pub struct Client { /* private fields */ }
Implementations§
Source§impl Client
impl Client
pub fn builder() -> ClientBuilder
pub fn debug_info(&self) -> String
pub fn is(&self, name: &str) -> Flag<'_>
Sourcepub async fn get_multiple(&self, names: &[&str]) -> HashMap<String, bool>
pub async fn get_multiple(&self, names: &[&str]) -> HashMap<String, bool>
Get the enabled status of multiple flags at once. This is more efficient than checking flags individually as it only requires a single cache lock and potential refresh.
§Example
let flags = client.get_multiple(&["feature-1", "feature-2", "feature-3"]).await;
for (name, enabled) in flags {
println!("{}: {}", name, enabled);
}
Sourcepub async fn all_enabled(&self, names: &[&str]) -> bool
pub async fn all_enabled(&self, names: &[&str]) -> bool
Check if all of the specified flags are enabled.
§Example
if client.all_enabled(&["feature-1", "feature-2"]).await {
// Both features are enabled
}
Sourcepub async fn any_enabled(&self, names: &[&str]) -> bool
pub async fn any_enabled(&self, names: &[&str]) -> bool
Check if any of the specified flags are enabled.
§Example
if client.any_enabled(&["premium-feature", "beta-feature"]).await {
// At least one feature is enabled
}
pub async fn list(&self) -> Result<Vec<FeatureFlag>, FlagError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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