pub struct MutationFaultContext<E> {
pub inner: E,
pub faults: MutationFaults,
}Expand description
Context wrapper whose mutating storage operations fail or park once the shared MutationFaults has let its allowed number succeed. Such an operation never reaches the wrapped storage.
Fields§
§inner: E§faults: MutationFaultsTrait Implementations§
Source§impl<E: Clock> Clock for MutationFaultContext<E>
impl<E: Clock> Clock for MutationFaultContext<E>
Source§fn current(&self) -> SystemTime
fn current(&self) -> SystemTime
Returns the current time.
Source§fn sleep(
&self,
duration: Duration,
) -> impl Future<Output = ()> + Send + 'static + use<E>
fn sleep( &self, duration: Duration, ) -> impl Future<Output = ()> + Send + 'static + use<E>
Sleep for the given duration.
Source§fn sleep_until(
&self,
deadline: SystemTime,
) -> impl Future<Output = ()> + Send + 'static + use<E>
fn sleep_until( &self, deadline: SystemTime, ) -> impl Future<Output = ()> + Send + 'static + use<E>
Sleep until the given deadline.
Source§impl<E: Clock> Clock for MutationFaultContext<E>
impl<E: Clock> Clock for MutationFaultContext<E>
Source§impl<E: Clone> Clone for MutationFaultContext<E>
impl<E: Clone> Clone for MutationFaultContext<E>
Source§impl<E: Metrics> Metrics for MutationFaultContext<E>
impl<E: Metrics> Metrics for MutationFaultContext<E>
Source§impl<E: Clock> ReasonablyRealtime for MutationFaultContext<E>
impl<E: Clock> ReasonablyRealtime for MutationFaultContext<E>
Source§fn reference_point(&self) -> Self::Instant
fn reference_point(&self) -> Self::Instant
Returns a reference point at the start of an operation.
Source§impl<E: Spawner> Spawner for MutationFaultContext<E>
impl<E: Spawner> Spawner for MutationFaultContext<E>
Source§fn spawn<F, Fut, T>(self, f: F) -> Handle<T> ⓘ
fn spawn<F, Fut, T>(self, f: F) -> Handle<T> ⓘ
Spawn a task with the current context. Read more
Source§async fn stop(self, value: i32, timeout: Option<Duration>) -> Result<(), Error>
async fn stop(self, value: i32, timeout: Option<Duration>) -> Result<(), Error>
Signals the runtime to stop execution and waits for all outstanding tasks
to perform any required cleanup and exit. Read more
Source§fn stopped(&self) -> Signal ⓘ
fn stopped(&self) -> Signal ⓘ
Returns an instance of a signal::Signal that resolves when Spawner::stop is called by
any task. Read more
Source§impl<E: Storage> Storage for MutationFaultContext<E>
impl<E: Storage> Storage for MutationFaultContext<E>
Source§type Blob = MutationFaultBlob<<E as Storage>::Blob>
type Blob = MutationFaultBlob<<E as Storage>::Blob>
The readable/writeable storage buffer that can be opened by this Storage.
Source§async fn open_versioned(
&self,
partition: &str,
name: &[u8],
versions: RangeInclusive<BlobVersion>,
) -> Result<(Self::Blob, u64, BlobVersion), Error>
async fn open_versioned( &self, partition: &str, name: &[u8], versions: RangeInclusive<BlobVersion>, ) -> Result<(Self::Blob, u64, BlobVersion), Error>
Open an existing blob in a given partition or create a new one, returning
the blob and its length. Read more
Source§async fn remove(
&self,
partition: &str,
name: Option<&[u8]>,
) -> Result<(), Error>
async fn remove( &self, partition: &str, name: Option<&[u8]>, ) -> Result<(), Error>
Remove a blob from a given partition. Read more
Source§impl<E: Supervisor> Supervisor for MutationFaultContext<E>
impl<E: Supervisor> Supervisor for MutationFaultContext<E>
impl<E: TryCryptoRng> TryCryptoRng for MutationFaultContext<E>
Source§impl<E: TryRng> TryRng for MutationFaultContext<E>
impl<E: TryRng> TryRng for MutationFaultContext<E>
Auto Trait Implementations§
impl<E> !RefUnwindSafe for MutationFaultContext<E>
impl<E> !UnwindSafe for MutationFaultContext<E>
impl<E> Forget for MutationFaultContext<E>
impl<E> Freeze for MutationFaultContext<E>where
E: Freeze,
impl<E> Move for MutationFaultContext<E>
impl<E> Send for MutationFaultContext<E>where
E: Send,
impl<E> Sync for MutationFaultContext<E>where
E: Sync,
impl<E> Unpin for MutationFaultContext<E>where
E: Unpin,
impl<E> UnsafeUnpin for MutationFaultContext<E>where
E: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<R> CryptoRng for R
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MetricsExt for Twhere
T: Metrics,
impl<T> MetricsExt for Twhere
T: Metrics,
Source§fn counter<N: Into<String>, H: Into<String>>(&self, name: N, help: H) -> Counter
fn counter<N: Into<String>, H: Into<String>>(&self, name: N, help: H) -> Counter
Register a counter with the runtime.
Source§fn gauge<N: Into<String>, H: Into<String>>(&self, name: N, help: H) -> Gauge
fn gauge<N: Into<String>, H: Into<String>>(&self, name: N, help: H) -> Gauge
Register a gauge with the runtime.
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<R> RngCore for Rwhere
R: Rng,
Source§impl<R> RngExt for R
impl<R> RngExt for R
Source§fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
Return a random value via the
StandardUniform distribution. Read moreSource§fn random_iter<T>(self) -> Iter<StandardUniform, Self, T> ⓘ
fn random_iter<T>(self) -> Iter<StandardUniform, Self, T> ⓘ
Source§fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Generate a random value in the given range. Read more
Source§fn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
Return a bool with a probability
p of being true. Read moreSource§fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
Return a bool with a probability of
numerator/denominator of being
true. Read moreSource§fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
Sample a new value, using the given distribution. Read more
Source§fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T> ⓘwhere
D: Distribution<T>,
Self: Sized,
fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T> ⓘwhere
D: Distribution<T>,
Self: Sized,
Create an iterator that generates values using the given distribution. Read more