pub struct StreamingDataSourceBuilder<C> { /* private fields */ }
Expand description
Contains methods for configuring the streaming data source.
By default, the SDK uses a streaming connection to receive feature flag data from LaunchDarkly. If you want to customize the behavior of the connection, create a builder StreamingDataSourceBuilder::new, change its properties with the methods of this class, and pass it to crate::ConfigBuilder::data_source.
§Examples
Adjust the initial reconnect delay.
ConfigBuilder::new("sdk-key").data_source(StreamingDataSourceBuilder::<hyper_rustls::HttpsConnector<HttpConnector>>::new()
.initial_reconnect_delay(Duration::from_secs(10)));
Implementations§
Source§impl<C> StreamingDataSourceBuilder<C>
impl<C> StreamingDataSourceBuilder<C>
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new instance of the StreamingDataSourceBuilder with default values.
Sourcepub fn initial_reconnect_delay(&mut self, duration: Duration) -> &mut Self
pub fn initial_reconnect_delay(&mut self, duration: Duration) -> &mut Self
Sets the initial reconnect delay for the streaming connection.
Sourcepub fn https_connector(&mut self, connector: C) -> &mut Self
pub fn https_connector(&mut self, connector: C) -> &mut Self
Sets the connector for the event source client to use. This allows for re-use of a
connector between multiple client instances. This is especially useful for the
sdk-test-harness
where many client instances are created throughout the test and reading
the native certificates is a substantial portion of the runtime.
Trait Implementations§
Source§impl<C: Clone> Clone for StreamingDataSourceBuilder<C>
impl<C: Clone> Clone for StreamingDataSourceBuilder<C>
Source§fn clone(&self) -> StreamingDataSourceBuilder<C>
fn clone(&self) -> StreamingDataSourceBuilder<C>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<C> Freeze for StreamingDataSourceBuilder<C>where
C: Freeze,
impl<C> RefUnwindSafe for StreamingDataSourceBuilder<C>where
C: RefUnwindSafe,
impl<C> Send for StreamingDataSourceBuilder<C>where
C: Send,
impl<C> Sync for StreamingDataSourceBuilder<C>where
C: Sync,
impl<C> Unpin for StreamingDataSourceBuilder<C>where
C: Unpin,
impl<C> UnwindSafe for StreamingDataSourceBuilder<C>where
C: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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