pub struct EventProcessorBuilder { /* private fields */ }
Expand description
Contains methods for configuring delivery of analytics events.
The SDK normally buffers analytics events and sends them to LaunchDarkly at intervals. If you want to customize this behavior, create a builder with crate::EventProcessorBuilder::new, change its properties with the methods of this struct, and pass it to crate::ConfigBuilder::event_processor.
§Examples
Adjust the flush interval
ConfigBuilder::new("sdk-key").event_processor(EventProcessorBuilder::new()
.flush_interval(Duration::from_secs(10)));
Implementations§
source§impl EventProcessorBuilder
impl EventProcessorBuilder
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new EventProcessorBuilder with all default values.
sourcepub fn capacity(&mut self, capacity: usize) -> &mut Self
pub fn capacity(&mut self, capacity: usize) -> &mut Self
Set the capacity of the events buffer.
The client buffers up to this many events in memory before flushing. If the capacity is exceeded before the buffer is flushed crate::EventProcessor::flush, events will be discarded. Increasing the capacity means that events are less likely to be discarded, at the cost of consuming more memory.
sourcepub fn flush_interval(&mut self, flush_interval: Duration) -> &mut Self
pub fn flush_interval(&mut self, flush_interval: Duration) -> &mut Self
Sets the interval between flushes of the event buffer.
Decreasing the flush interval means that the event buffer is less likely to reach capacity.
sourcepub fn context_keys_capacity(
&mut self,
context_keys_capacity: NonZeroUsize,
) -> &mut Self
pub fn context_keys_capacity( &mut self, context_keys_capacity: NonZeroUsize, ) -> &mut Self
Sets the number of context keys that the event processor can remember at any one time.
To avoid sending duplicate context details in analytics events, the SDK maintains a cache of recently seen context keys.
sourcepub fn context_keys_flush_interval(
&mut self,
context_keys_flush_interval: Duration,
) -> &mut Self
pub fn context_keys_flush_interval( &mut self, context_keys_flush_interval: Duration, ) -> &mut Self
Sets the interval at which the event processor will reset its cache of known context keys.
sourcepub fn all_attributes_private(
&mut self,
all_attributes_private: bool,
) -> &mut Self
pub fn all_attributes_private( &mut self, all_attributes_private: bool, ) -> &mut Self
Sets whether or not all optional user attributes should be hidden from LaunchDarkly.
If this is true, all user attribute values (other than the key) will be private, not just the attributes specified with private_attributes or on a per-user basis with UserBuilder methods. By default, it is false.
sourcepub fn private_attributes<R>(&mut self, attributes: HashSet<R>) -> &mut Self
pub fn private_attributes<R>(&mut self, attributes: HashSet<R>) -> &mut Self
Marks a set of attribute names as always private.
Any users sent to LaunchDarkly with this configuration active will have attributes with these names removed. This is in addition to any attributes that were marked as private for an individual user with UserBuilder methods. Setting all_attribute_private to true overrides this.
Trait Implementations§
source§impl Clone for EventProcessorBuilder
impl Clone for EventProcessorBuilder
source§fn clone(&self) -> EventProcessorBuilder
fn clone(&self) -> EventProcessorBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for EventProcessorBuilder
impl !RefUnwindSafe for EventProcessorBuilder
impl Send for EventProcessorBuilder
impl Sync for EventProcessorBuilder
impl Unpin for EventProcessorBuilder
impl !UnwindSafe for EventProcessorBuilder
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)