[−][src]Struct unleash_api_client::client::Client
Implementations
impl<C: HttpClient + Default> Client<C>
[src]
pub fn new(
api_url: &str,
app_name: &str,
instance_id: &str,
authorization: Option<String>
) -> Result<Self, Error>
[src]
api_url: &str,
app_name: &str,
instance_id: &str,
authorization: Option<String>
) -> Result<Self, Error>
pub fn is_enabled(
&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.
Trait Implementations
impl<C: HttpClient + Default> Sync for Client<C>
[src]
Auto Trait Implementations
impl<C> !RefUnwindSafe for Client<C>
impl<C> Send for Client<C>
impl<C> Unpin for Client<C>
impl<C> !UnwindSafe for Client<C>
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, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,