#[non_exhaustive]pub struct DbFeatureDriver { /* private fields */ }Expand description
Feature flag driver backed by a database table rullst_feature_flags.
Features a high-performance concurrent local cache with custom TTL to ensure sub-millisecond lookups.
§Note on Database Pool Initialization
This driver requires a live database pool to function. If feature flags are evaluated before the
database connection pool has been initialized (e.g., in early application startup or static constructors),
this driver will gracefully return None (falling through to subsequent drivers in the chain)
rather than blocking or panicking.
Implementations§
Trait Implementations§
Source§impl Default for DbFeatureDriver
impl Default for DbFeatureDriver
Source§impl FeatureDriver for DbFeatureDriver
impl FeatureDriver for DbFeatureDriver
Source§fn enabled<'life0, 'life1, 'async_trait>(
&'life0 self,
flag: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn enabled<'life0, 'life1, 'async_trait>(
&'life0 self,
flag: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if a feature flag is enabled.
Source§fn enabled_for<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
flag: &'life1 str,
identifier: &'life2 str,
) -> Pin<Box<dyn Future<Output = Option<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn enabled_for<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
flag: &'life1 str,
identifier: &'life2 str,
) -> Pin<Box<dyn Future<Output = Option<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Check if a feature flag is enabled for a specific target identifier.
Source§fn variant<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
flag: &'life1 str,
identifier: &'life2 str,
) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn variant<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
flag: &'life1 str,
identifier: &'life2 str,
) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieve the variation name assigned to a specific target identifier.
Auto Trait Implementations§
impl !RefUnwindSafe for DbFeatureDriver
impl Freeze for DbFeatureDriver
impl Send for DbFeatureDriver
impl Sync for DbFeatureDriver
impl Unpin for DbFeatureDriver
impl UnsafeUnpin for DbFeatureDriver
impl UnwindSafe for DbFeatureDriver
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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