pub struct BreakerSampler<S> { /* private fields */ }Expand description
Sampler wrapper that refuses traffic while the breaker is open.
Implementations§
Source§impl<S> BreakerSampler<S>
impl<S> BreakerSampler<S>
Trait Implementations§
Source§impl<S> Clone for BreakerSampler<S>where
S: Clone,
impl<S> Clone for BreakerSampler<S>where
S: Clone,
Source§fn clone(&self) -> BreakerSampler<S>
fn clone(&self) -> BreakerSampler<S>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<S> Debug for BreakerSampler<S>where
S: Debug,
impl<S> Debug for BreakerSampler<S>where
S: Debug,
Source§impl<S> LlmSampler for BreakerSampler<S>where
S: LlmSampler + 'static,
impl<S> LlmSampler for BreakerSampler<S>where
S: LlmSampler + 'static,
Source§fn sample<'life0, 'async_trait>(
&'life0 self,
request: SampleRequest,
) -> Pin<Box<dyn Future<Output = Result<SampleResponse, MachiError>> + Send + 'async_trait>>where
'life0: 'async_trait,
BreakerSampler<S>: 'async_trait,
fn sample<'life0, 'async_trait>(
&'life0 self,
request: SampleRequest,
) -> Pin<Box<dyn Future<Output = Result<SampleResponse, MachiError>> + Send + 'async_trait>>where
'life0: 'async_trait,
BreakerSampler<S>: 'async_trait,
Perform one non-streaming sample.
Source§fn sample_stream<'life0, 'async_trait>(
&'life0 self,
request: SampleRequest,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = SampleEvent> + Send>>, MachiError>> + Send + 'async_trait>>where
'life0: 'async_trait,
BreakerSampler<S>: 'async_trait,
fn sample_stream<'life0, 'async_trait>(
&'life0 self,
request: SampleRequest,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = SampleEvent> + Send>>, MachiError>> + Send + 'async_trait>>where
'life0: 'async_trait,
BreakerSampler<S>: 'async_trait,
Streaming sample. Default: call
Self::sample and emit a single
SampleEvent::Completed (plus usage when non-zero).Auto Trait Implementations§
impl<S> Freeze for BreakerSampler<S>
impl<S> RefUnwindSafe for BreakerSampler<S>where
S: RefUnwindSafe,
impl<S> Send for BreakerSampler<S>
impl<S> Sync for BreakerSampler<S>
impl<S> Unpin for BreakerSampler<S>
impl<S> UnsafeUnpin for BreakerSampler<S>
impl<S> UnwindSafe for BreakerSampler<S>where
S: RefUnwindSafe,
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
Mutably borrows from an owned value. Read more