pub struct FeatureFlagsBuilder { /* private fields */ }Expand description
Builder for FeatureFlags
§Examples
Building flags for development environment:
use chie_shared::FeatureFlagsBuilder;
let flags = FeatureFlagsBuilder::new()
.beta(true)
.debug_mode(true)
.performance_profiling(true)
.enhanced_telemetry(true)
.build();
assert!(flags.beta);
assert!(flags.debug_mode);
assert!(flags.has_diagnostic_features());Building flags for staging environment:
use chie_shared::FeatureFlagsBuilder;
let flags = FeatureFlagsBuilder::new()
.beta(true)
.enhanced_telemetry(true)
.compression_optimization(true)
.adaptive_retry(true)
.build();
assert!(flags.beta);
assert!(!flags.experimental); // Not ready for experimental
assert!(flags.enhanced_telemetry);Implementations§
Source§impl FeatureFlagsBuilder
impl FeatureFlagsBuilder
Sourcepub const fn experimental(self, enable: bool) -> Self
pub const fn experimental(self, enable: bool) -> Self
Enable or disable experimental features
Sourcepub const fn enhanced_telemetry(self, enable: bool) -> Self
pub const fn enhanced_telemetry(self, enable: bool) -> Self
Enable or disable enhanced telemetry
Sourcepub const fn performance_profiling(self, enable: bool) -> Self
pub const fn performance_profiling(self, enable: bool) -> Self
Enable or disable performance profiling
Sourcepub const fn debug_mode(self, enable: bool) -> Self
pub const fn debug_mode(self, enable: bool) -> Self
Enable or disable debug mode
Sourcepub const fn compression_optimization(self, enable: bool) -> Self
pub const fn compression_optimization(self, enable: bool) -> Self
Enable or disable compression optimization
Sourcepub const fn adaptive_retry(self, enable: bool) -> Self
pub const fn adaptive_retry(self, enable: bool) -> Self
Enable or disable adaptive retry
Sourcepub const fn build(self) -> FeatureFlags
pub const fn build(self) -> FeatureFlags
Build the feature flags configuration
Trait Implementations§
Source§impl Debug for FeatureFlagsBuilder
impl Debug for FeatureFlagsBuilder
Source§impl Default for FeatureFlagsBuilder
impl Default for FeatureFlagsBuilder
Source§fn default() -> FeatureFlagsBuilder
fn default() -> FeatureFlagsBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FeatureFlagsBuilder
impl RefUnwindSafe for FeatureFlagsBuilder
impl Send for FeatureFlagsBuilder
impl Sync for FeatureFlagsBuilder
impl Unpin for FeatureFlagsBuilder
impl UnwindSafe for FeatureFlagsBuilder
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