pub struct FeatureDetector { /* private fields */ }
Expand description
Feature detection and enforcement utilities
Implementations§
Source§impl FeatureDetector
impl FeatureDetector
pub fn new() -> Self
Sourcepub async fn is_feature_available(
&self,
context: &RuntimeContext,
feature: &str,
) -> FeatureStatus
pub async fn is_feature_available( &self, context: &RuntimeContext, feature: &str, ) -> FeatureStatus
Check if a feature is available through runtime detection
Sourcepub async fn get_features_status(
&self,
context: &RuntimeContext,
features: Vec<&str>,
) -> Vec<FeatureStatus>
pub async fn get_features_status( &self, context: &RuntimeContext, features: Vec<&str>, ) -> Vec<FeatureStatus>
Get status for multiple features
Sourcepub async fn get_category_status(
&self,
context: &RuntimeContext,
category: &str,
) -> Vec<FeatureStatus>
pub async fn get_category_status( &self, context: &RuntimeContext, category: &str, ) -> Vec<FeatureStatus>
Get status for all features in a category
Sourcepub async fn require_feature(
&self,
context: &RuntimeContext,
feature: &str,
) -> Result<()>
pub async fn require_feature( &self, context: &RuntimeContext, feature: &str, ) -> Result<()>
Require a specific feature or return error
Sourcepub async fn get_feature_summary(
&self,
context: &RuntimeContext,
) -> FeatureSummary
pub async fn get_feature_summary( &self, context: &RuntimeContext, ) -> FeatureSummary
Get a user-friendly feature availability summary
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FeatureDetector
impl RefUnwindSafe for FeatureDetector
impl Send for FeatureDetector
impl Sync for FeatureDetector
impl Unpin for FeatureDetector
impl UnwindSafe for FeatureDetector
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more