Struct ClientSpinner

Source
pub struct ClientSpinner { /* private fields */ }
Expand description

A struct responsible for performing batch requests and probes with retry logic.

This struct abstracts the client and provides methods to perform multiple probes or requests with retry capabilities. The number of retries can be configured during initialization.

Implementations§

Source§

impl ClientSpinner

Source

pub fn new(client: Client) -> Self

Creates a new instance of ClientSpinner with the given Client.

This constructor initializes a ClientSpinner with a client and sets the number of retries to 0 (no retries).

Source

pub fn with_retries(self, n_retires: usize) -> Self

Sets the number of retries for subsequent probes and requests.

Source

pub async fn probe_batch( &self, inputs: &[ProbeInput], ) -> Result<Vec<ProbeOutcome>>

Performs a batch of probes asynchronously with retries.

This method takes an array of ProbeInput and attempts to probe each one. If a probe fails, it will retry up to n_retries times before returning the results.

Source

pub async fn request_batch( &self, inputs: &[RequestInput], ) -> Result<Vec<RequestOutcome>>

Performs a batch of requests asynchronously with retries.

This method takes an array of RequestInput and attempts to request each one. If a request fails, it will retry up to n_retries times before returning the results.

Trait Implementations§

Source§

impl Debug for ClientSpinner

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.