[−][src]Struct unleash_api_client::client::Client
Implementations
impl<C, F> Client<C, F> where
C: HttpClient + Default,
F: Enum<CachedFeature> + Clone + Debug + DeserializeOwned + Serialize,
[src]
C: HttpClient + Default,
F: Enum<CachedFeature> + Clone + Debug + DeserializeOwned + Serialize,
pub fn is_enabled(
&self,
feature_enum: F,
context: Option<&Context>,
default: bool
) -> bool
[src]
&self,
feature_enum: F,
context: Option<&Context>,
default: bool
) -> bool
pub fn is_enabled_str(
&self,
feature_name: &str,
context: Option<&Context>,
default: bool
) -> bool
[src]
&self,
feature_name: &str,
context: Option<&Context>,
default: bool
) -> bool
pub fn memoize(
&self,
features: Vec<Feature>
) -> Result<Option<Metrics>, Box<dyn Error>>
[src]
&self,
features: Vec<Feature>
) -> Result<Option<Metrics>, Box<dyn Error>>
Memoize new features into the cached state
Interior mutability is used, via the arc-swap crate.
Note that this is primarily public to facilitate benchmarking; poll_for_updates is the usual way in which memoize will be called.
pub async fn poll_for_updates<'_>(&'_ self)
[src]
Query the API endpoint for features and push metrics
Immediately and then every self.interval milliseconds the API server is queryed for features and the previous cycles metrics are uploaded.
May be dropped, or will terminate at the next polling cycle after stop_poll is called().
pub async fn register<'_>(
&'_ self
) -> Result<(), Box<dyn Error + Send + Sync + 'static>>
[src]
&'_ self
) -> Result<(), Box<dyn Error + Send + Sync + 'static>>
Register this client with the API endpoint.
pub async fn stop_poll<'_>(&'_ self)
[src]
stop the poll_for_updates() function.
If poll is not running, will wait-loop until poll_for_updates is running, then signal it to stop, then return. Will wait for ever if poll_for_updates never starts running.
Auto Trait Implementations
impl<C, F> !RefUnwindSafe for Client<C, F>
impl<C, F> Send for Client<C, F> where
<F as Enum<CachedFeature>>::Array: Send + Sync,
<F as Enum<CachedFeature>>::Array: Send + Sync,
impl<C, F> Sync for Client<C, F> where
<F as Enum<CachedFeature>>::Array: Send + Sync,
<F as Enum<CachedFeature>>::Array: Send + Sync,
impl<C, F> Unpin for Client<C, F>
impl<C, F> !UnwindSafe for Client<C, F>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Sealed<T> for T where
T: ?Sized,
T: ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
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>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
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>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,