pub struct ConfigBuilder { /* private fields */ }
Expand description
Used to create a Config struct for creating crate::Client instances.
For usage examples see:
Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
Sourcepub fn new(sdk_key: &str) -> Self
pub fn new(sdk_key: &str) -> Self
Create a new instance of the ConfigBuilder with the provided sdk_key
.
Sourcepub fn service_endpoints(self, builder: &ServiceEndpointsBuilder) -> Self
pub fn service_endpoints(self, builder: &ServiceEndpointsBuilder) -> Self
Set the URLs to use for this client. For usage see ServiceEndpointsBuilder
Sourcepub fn data_store(self, builder: &dyn DataStoreFactory) -> Self
pub fn data_store(self, builder: &dyn DataStoreFactory) -> Self
Set the data store to use for this client.
By default, the SDK uses an in-memory data store. For a persistent store, see PersistentDataStoreBuilder.
Sourcepub fn data_source(self, builder: &dyn DataSourceFactory) -> Self
pub fn data_source(self, builder: &dyn DataSourceFactory) -> Self
Set the data source to use for this client. For the streaming data source, see StreamingDataSourceBuilder.
If offline mode is enabled, this data source will be ignored.
Sourcepub fn event_processor(self, builder: &dyn EventProcessorFactory) -> Self
pub fn event_processor(self, builder: &dyn EventProcessorFactory) -> Self
Set the event processor to use for this client. For usage see EventProcessorBuilder.
If offline mode is enabled, this event processor will be ignored.
Sourcepub fn offline(self, offline: bool) -> Self
pub fn offline(self, offline: bool) -> Self
Whether the client should be initialized in offline mode.
In offline mode, default values are returned for all flags and no remote network requests are made. By default, this is false.
Sourcepub fn daemon_mode(self, enable: bool) -> Self
pub fn daemon_mode(self, enable: bool) -> Self
Whether the client should operate in daemon mode.
In daemon mode, the client will not receive updates directly from LaunchDarkly. Instead, the client will rely on the data store to provide the latest feature flag values. By default, this is false.
Sourcepub fn application_info(self, application_info: ApplicationInfo) -> Self
pub fn application_info(self, application_info: ApplicationInfo) -> Self
Provides configuration of application metadata.
These properties are optional and informational. They may be used in LaunchDarkly analytics or other product features, but they do not affect feature flag evaluations.
Sourcepub fn build(self) -> Result<Config, BuildError>
pub fn build(self) -> Result<Config, BuildError>
Create a new instance of Config based on the ConfigBuilder configuration.
Auto Trait Implementations§
impl Freeze for ConfigBuilder
impl !RefUnwindSafe for ConfigBuilder
impl !Send for ConfigBuilder
impl !Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl !UnwindSafe for ConfigBuilder
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
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>
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>
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