pub struct FeatureFlags {
pub experimental: bool,
pub beta: bool,
pub enhanced_telemetry: bool,
pub performance_profiling: bool,
pub debug_mode: bool,
pub compression_optimization: bool,
pub adaptive_retry: bool,
}Expand description
Feature flags for runtime feature toggling
§Examples
Using the default configuration (production-ready features enabled):
use chie_shared::FeatureFlags;
let flags = FeatureFlags::default();
assert!(!flags.experimental);
assert!(!flags.beta);
assert!(flags.compression_optimization);
assert!(flags.adaptive_retry);
assert!(!flags.has_unstable_features());Using preset configurations:
use chie_shared::FeatureFlags;
// All features disabled (minimal mode)
let minimal = FeatureFlags::none();
assert!(!minimal.compression_optimization);
assert!(!minimal.has_diagnostic_features());
// All features enabled (debug/testing mode)
let all = FeatureFlags::all();
assert!(all.experimental);
assert!(all.debug_mode);
assert!(all.has_unstable_features());
assert!(all.has_diagnostic_features());Building a custom configuration:
use chie_shared::FeatureFlagsBuilder;
let flags = FeatureFlagsBuilder::new()
.experimental(true)
.performance_profiling(true)
.enhanced_telemetry(true)
.build();
assert!(flags.experimental);
assert!(flags.performance_profiling);
assert!(flags.has_unstable_features());
assert!(flags.has_diagnostic_features());Fields§
§experimental: boolEnable experimental features
beta: boolEnable beta features
enhanced_telemetry: boolEnable enhanced telemetry
performance_profiling: boolEnable performance profiling
debug_mode: boolEnable debug mode
compression_optimization: boolEnable compression optimization
adaptive_retry: boolEnable adaptive retry
Implementations§
Source§impl FeatureFlags
impl FeatureFlags
Sourcepub const fn none() -> Self
pub const fn none() -> Self
Create a new feature flags configuration with all features disabled
Sourcepub const fn has_unstable_features(&self) -> bool
pub const fn has_unstable_features(&self) -> bool
Check if any experimental or beta feature is enabled
Sourcepub const fn has_diagnostic_features(&self) -> bool
pub const fn has_diagnostic_features(&self) -> bool
Check if any diagnostic feature is enabled
Trait Implementations§
Source§impl Clone for FeatureFlags
impl Clone for FeatureFlags
Source§fn clone(&self) -> FeatureFlags
fn clone(&self) -> FeatureFlags
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FeatureFlags
impl Debug for FeatureFlags
Source§impl Default for FeatureFlags
impl Default for FeatureFlags
Source§impl<'de> Deserialize<'de> for FeatureFlags
impl<'de> Deserialize<'de> for FeatureFlags
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FeatureFlags
impl RefUnwindSafe for FeatureFlags
impl Send for FeatureFlags
impl Sync for FeatureFlags
impl Unpin for FeatureFlags
impl UnwindSafe for FeatureFlags
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