Struct open_feature::OpenFeature
source · pub struct OpenFeature { /* private fields */ }Expand description
THE struct of the OpenFeature API.
Access it via the [SINGLETON] instance.
Implementations§
source§impl OpenFeature
impl OpenFeature
sourcepub async fn singleton() -> RwLockReadGuard<'static, Self>
pub async fn singleton() -> RwLockReadGuard<'static, Self>
Get the singleton of OpenFeature.
sourcepub async fn singleton_mut() -> RwLockWriteGuard<'static, Self>
pub async fn singleton_mut() -> RwLockWriteGuard<'static, Self>
Get a mutable singleton of OpenFeature.
sourcepub async fn set_evaluation_context(
&mut self,
evaluation_context: EvaluationContext
)
pub async fn set_evaluation_context( &mut self, evaluation_context: EvaluationContext )
Set the global evaluation context.
sourcepub async fn set_provider<T: FeatureProvider>(&mut self, provider: T)
pub async fn set_provider<T: FeatureProvider>(&mut self, provider: T)
Set the default provider.
sourcepub async fn set_named_provider<T: FeatureProvider>(
&mut self,
name: &str,
provider: T
)
pub async fn set_named_provider<T: FeatureProvider>( &mut self, name: &str, provider: T )
Bind the given provider to the corresponding name.
sourcepub async fn provider_metadata(&self) -> ProviderMetadata
pub async fn provider_metadata(&self) -> ProviderMetadata
Return the metadata of default (unnamed) provider.
sourcepub async fn named_provider_metadata(
&self,
name: &str
) -> Option<ProviderMetadata>
pub async fn named_provider_metadata( &self, name: &str ) -> Option<ProviderMetadata>
Return the metadata of named provider (a provider bound to clients with this name).
sourcepub fn create_client(&self) -> Client
pub fn create_client(&self) -> Client
Create a new client with default name.
sourcepub fn create_named_client(&self, name: &str) -> Client
pub fn create_named_client(&self, name: &str) -> Client
Create a new client with specific name.
It will use the provider bound to this name, if any.
Trait Implementations§
source§impl Default for OpenFeature
impl Default for OpenFeature
source§fn default() -> OpenFeature
fn default() -> OpenFeature
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for OpenFeature
impl Send for OpenFeature
impl Sync for OpenFeature
impl Unpin for OpenFeature
impl !UnwindSafe for OpenFeature
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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