Feature Flag Manager (src/features.rs)

Codewhale · crates/runtime/src/features.rs · rust · MIT
ai, dev-tools, analytics, tag:config, tag:runtime

Manages application feature flags, lifecycle stages, and configuration metadata. Use this to toggle experimental features or manage runtime capabilities in a modular application.

// Source: https://github.com/Hmbown/Codewhale | License: MIT | Copyright 2024-2025 DeepSeek-TUI Contributors
// Provided via justclaw.it.com; keep this notice with the code.
//! Feature flags and metadata for codewhale.

use std::collections::{BTreeMap, BTreeSet};
use std::fmt::{self, Write as _};

use serde::{Deserialize, Deserializer, Serialize, de};

/// Lifecycle stage for a feature flag.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Stage {
    Experimental,
    Beta,
    Stable,
}

impl Stage {
    pub fn as_str(self) -> &'static str {
        match self {
            Self::Experimental => "experimental",
            Self::Beta => "beta",
            Self::Stable => "stable",
        }
    }
}

/// Unique features toggled via configuration.
#[derive(Debug, Clone, Copy, Parti

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key