flags-rs

Crates.ioflags-rs
lib.rsflags-rs
version0.1.9
created_at2025-05-14 22:44:23.392336+00
updated_at2025-08-19 21:44:38.853573+00
descriptionRust Library for Flags.gg
homepagehttps://flags.gg
repositoryhttps://github.com/flags-gg/flags-rs
max_upload_size
id1674038
size122,567
Max Hooton (Keloran)

documentation

README

Flags.gg Rust Library

use flags_rs::{Auth, Client};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Initialize the client
    let client = Client::builder()
        .with_auth(Auth {
            project_id: "your-project-id".to_string(),
            agent_id: "your-agent-id".to_string(),
            environment_id: "your-environment-id".to_string(),
        })
        .with_memory_cache()
        .build();

    // Check if a flag is enabled
    let is_feature_enabled = client.is("my-feature").enabled().await;
    println!("Feature 'my-feature' is enabled: {}", is_feature_enabled);

    // List all flags
    let all_flags = client.list().await?;
    println!("All flags:");
    for flag in all_flags {
        println!("  {} ({}): {}", flag.details.name, flag.details.id, flag.enabled);
    }

    Ok(())
}
Commit count: 69

cargo fmt