StatsigClientConfigBuilder

Struct StatsigClientConfigBuilder 

Source
pub struct StatsigClientConfigBuilder<S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<S: State> StatsigClientConfigBuilder<S>

Source

pub fn build(self) -> StatsigClientConfig
where S: IsComplete,

Finish building and return the requested object

Source

pub fn api_key( self, value: impl Into<String>, ) -> StatsigClientConfigBuilder<SetApiKey<S>>
where S::ApiKey: IsUnset,

Required.

Source

pub fn base_url( self, value: String, ) -> StatsigClientConfigBuilder<SetBaseUrl<S>>
where S::BaseUrl: IsUnset,

Optional (Some / Option setters). Default: "https://api.statsig.com".to_string().

Source

pub fn maybe_base_url( self, value: Option<String>, ) -> StatsigClientConfigBuilder<SetBaseUrl<S>>
where S::BaseUrl: IsUnset,

Optional (Some / Option setters). Default: "https://api.statsig.com".to_string().

Source

pub fn events_base_url( self, value: String, ) -> StatsigClientConfigBuilder<SetEventsBaseUrl<S>>
where S::EventsBaseUrl: IsUnset,

Optional (Some / Option setters). Default: "https://events.statsigapi.net".to_string().

Source

pub fn maybe_events_base_url( self, value: Option<String>, ) -> StatsigClientConfigBuilder<SetEventsBaseUrl<S>>
where S::EventsBaseUrl: IsUnset,

Optional (Some / Option setters). Default: "https://events.statsigapi.net".to_string().

Source

pub fn timeout( self, value: Duration, ) -> StatsigClientConfigBuilder<SetTimeout<S>>
where S::Timeout: IsUnset,

Optional (Some / Option setters). Default: Duration::from_secs(30).

Source

pub fn maybe_timeout( self, value: Option<Duration>, ) -> StatsigClientConfigBuilder<SetTimeout<S>>
where S::Timeout: IsUnset,

Optional (Some / Option setters). Default: Duration::from_secs(30).

Source

pub fn retry_attempts( self, value: u32, ) -> StatsigClientConfigBuilder<SetRetryAttempts<S>>
where S::RetryAttempts: IsUnset,

Optional (Some / Option setters). Default: 3.

Source

pub fn maybe_retry_attempts( self, value: Option<u32>, ) -> StatsigClientConfigBuilder<SetRetryAttempts<S>>
where S::RetryAttempts: IsUnset,

Optional (Some / Option setters). Default: 3.

Source

pub fn retry_delay( self, value: Duration, ) -> StatsigClientConfigBuilder<SetRetryDelay<S>>
where S::RetryDelay: IsUnset,

Optional (Some / Option setters). Default: Duration::from_millis(1000).

Source

pub fn maybe_retry_delay( self, value: Option<Duration>, ) -> StatsigClientConfigBuilder<SetRetryDelay<S>>
where S::RetryDelay: IsUnset,

Optional (Some / Option setters). Default: Duration::from_millis(1000).

Source

pub fn cache_ttl( self, value: Duration, ) -> StatsigClientConfigBuilder<SetCacheTtl<S>>
where S::CacheTtl: IsUnset,

Optional (Some / Option setters). Default: Duration::from_secs(300).

Source

pub fn maybe_cache_ttl( self, value: Option<Duration>, ) -> StatsigClientConfigBuilder<SetCacheTtl<S>>
where S::CacheTtl: IsUnset,

Optional (Some / Option setters). Default: Duration::from_secs(300).

Source

pub fn cache_max_capacity( self, value: u64, ) -> StatsigClientConfigBuilder<SetCacheMaxCapacity<S>>
where S::CacheMaxCapacity: IsUnset,

Optional (Some / Option setters). Default: 10000.

Source

pub fn maybe_cache_max_capacity( self, value: Option<u64>, ) -> StatsigClientConfigBuilder<SetCacheMaxCapacity<S>>
where S::CacheMaxCapacity: IsUnset,

Optional (Some / Option setters). Default: 10000.

Source

pub fn batch_size( self, value: usize, ) -> StatsigClientConfigBuilder<SetBatchSize<S>>
where S::BatchSize: IsUnset,

Optional (Some / Option setters). Default: 10.

Source

pub fn maybe_batch_size( self, value: Option<usize>, ) -> StatsigClientConfigBuilder<SetBatchSize<S>>
where S::BatchSize: IsUnset,

Optional (Some / Option setters). Default: 10.

Source

pub fn batch_flush_interval( self, value: Duration, ) -> StatsigClientConfigBuilder<SetBatchFlushInterval<S>>
where S::BatchFlushInterval: IsUnset,

Optional (Some / Option setters). Default: Duration::from_millis(100).

Source

pub fn maybe_batch_flush_interval( self, value: Option<Duration>, ) -> StatsigClientConfigBuilder<SetBatchFlushInterval<S>>
where S::BatchFlushInterval: IsUnset,

Optional (Some / Option setters). Default: Duration::from_millis(100).

Source

pub fn offline_fallback( self, value: bool, ) -> StatsigClientConfigBuilder<SetOfflineFallback<S>>
where S::OfflineFallback: IsUnset,

Optional (Some / Option setters). Default: false.

Source

pub fn maybe_offline_fallback( self, value: Option<bool>, ) -> StatsigClientConfigBuilder<SetOfflineFallback<S>>
where S::OfflineFallback: IsUnset,

Optional (Some / Option setters). Default: false.

Source

pub fn exposure_logging_disabled( self, value: bool, ) -> StatsigClientConfigBuilder<SetExposureLoggingDisabled<S>>
where S::ExposureLoggingDisabled: IsUnset,

Optional (Some / Option setters). Default: false.

Source

pub fn maybe_exposure_logging_disabled( self, value: Option<bool>, ) -> StatsigClientConfigBuilder<SetExposureLoggingDisabled<S>>
where S::ExposureLoggingDisabled: IsUnset,

Optional (Some / Option setters). Default: false.

Source

pub fn sdk_type( self, value: String, ) -> StatsigClientConfigBuilder<SetSdkType<S>>
where S::SdkType: IsUnset,

Optional (Some / Option setters). Default: "rust-client".to_string().

Source

pub fn maybe_sdk_type( self, value: Option<String>, ) -> StatsigClientConfigBuilder<SetSdkType<S>>
where S::SdkType: IsUnset,

Optional (Some / Option setters). Default: "rust-client".to_string().

Source

pub fn sdk_version( self, value: String, ) -> StatsigClientConfigBuilder<SetSdkVersion<S>>
where S::SdkVersion: IsUnset,

Optional (Some / Option setters). Default: env!("CARGO_PKG_VERSION").to_string().

Source

pub fn maybe_sdk_version( self, value: Option<String>, ) -> StatsigClientConfigBuilder<SetSdkVersion<S>>
where S::SdkVersion: IsUnset,

Optional (Some / Option setters). Default: env!("CARGO_PKG_VERSION").to_string().

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more