Skip to main content

MutationFaultContext

Struct MutationFaultContext 

Source
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: MutationFaults

Trait Implementations§

Source§

impl<E: Clock> Clock for MutationFaultContext<E>

Source§

fn current(&self) -> SystemTime

Returns the current time.
Source§

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>

Sleep until the given deadline.
Source§

fn timeout<F, T>( &self, duration: Duration, future: F, ) -> impl Future<Output = Result<T, Error>> + Send + '_
where F: Future<Output = T> + Send + 'static, T: Send + 'static,

Await a future with a timeout, returning Error::Timeout if it expires. Read more
Source§

impl<E: Clock> Clock for MutationFaultContext<E>

Source§

type Instant = SystemTime

A measurement of a monotonically increasing clock.
Source§

fn now(&self) -> Self::Instant

Returns a measurement of the clock.
Source§

impl<E: Clone> Clone for MutationFaultContext<E>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<E: Metrics> Metrics for MutationFaultContext<E>

Source§

fn register<N: Into<String>, H: Into<String>, M: Metric>( &self, name: N, help: H, metric: M, ) -> Registered<M>

Register a metric with the runtime. Read more
Source§

fn encode(&self) -> String

Encode all metrics into a buffer.
Source§

impl<E: Clock> ReasonablyRealtime for MutationFaultContext<E>

Source§

fn reference_point(&self) -> Self::Instant

Returns a reference point at the start of an operation.
Source§

impl<E: Spawner> Spawner for MutationFaultContext<E>

Source§

fn shared(self, blocking: bool) -> Self

Return a Spawner that schedules the next task onto the runtime’s shared executor. Read more
Source§

fn dedicated(self) -> Self

Return a Spawner that runs the next task on a dedicated thread when the runtime supports it. Read more
Source§

fn spawn<F, Fut, T>(self, f: F) -> Handle<T> ⓘ
where F: FnOnce(Self) -> Fut + Send + 'static, Fut: Future<Output = T> + Send + 'static, T: Send + 'static,

Spawn a task with the current context. Read more
Source§

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 ⓘ

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>

Source§

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>

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>

Remove a blob from a given partition. Read more
Source§

async fn scan(&self, partition: &str) -> Result<Vec<Vec<u8>>, Error>

Return all blobs in a given partition.
Source§

fn open( &self, partition: &str, name: &[u8], ) -> impl Future<Output = Result<(Self::Blob, u64), Error>> + Send

Storage::open_versioned with DEFAULT_BLOB_VERSION as the only value in the versions range. The blob version is omitted from the return value.
Source§

impl<E: Supervisor> Supervisor for MutationFaultContext<E>

Source§

fn name(&self) -> Name

Return the current label prefix and attributes.
Source§

fn child(&self, label: &'static str) -> Self

Create a named child context with a new supervision-tree node. Read more
Source§

fn with_attribute(self, key: &'static str, value: impl Display) -> Self

Add a key-value attribute to this context’s identity. Read more
Source§

impl<E: TryCryptoRng> TryCryptoRng for MutationFaultContext<E>

Source§

impl<E: TryRng> TryRng for MutationFaultContext<E>

Source§

type Error = <E as TryRng>::Error

The type returned in the event of a RNG error. Read more
Source§

fn try_next_u32(&mut self) -> Result<u32, Self::Error>

Return the next random u32.
Source§

fn try_next_u64(&mut self) -> Result<u64, Self::Error>

Return the next random u64.
Source§

fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Self::Error>

Fill dst entirely with random data.

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> 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<R> CryptoRng for R
where R: TryCryptoRng<Error = !> + ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self> ⓘ

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> MetricsExt for T
where T: Metrics,

Source§

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

Register a gauge with the runtime.
Source§

fn histogram<N: Into<String>, H: Into<String>, I>( &self, name: N, help: H, buckets: I, ) -> Histogram
where I: IntoIterator<Item = f64>,

Register a histogram with the runtime.
Source§

fn family<N, H, S, M>(&self, name: N, help: H) -> Registered<Family<S, M>>
where N: Into<String>, H: Into<String>, S: Clone + Hash + Eq, M: Default, Family<S, M>: Metric,

Register a metric family with the runtime.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<R> Rng for R
where R: TryRng<Error = !> + ?Sized,

Source§

fn next_u32(&mut self) -> u32

Return the next random u32.
Source§

fn next_u64(&mut self) -> u64

Return the next random u64.
Source§

fn fill_bytes(&mut self, dst: &mut [u8])

Fill dest with random data. Read more
Source§

impl<R> RngCore for R
where R: Rng,

Source§

impl<R> RngExt for R
where R: Rng + ?Sized,

Source§

fn random<T>(&mut self) -> T

Return a random value via the StandardUniform distribution. Read more
Source§

fn random_iter<T>(self) -> Iter<StandardUniform, Self, T> ⓘ

Return an iterator over random variates Read more
Source§

fn random_range<T, R>(&mut self, range: R) -> T
where T: SampleUniform, R: SampleRange<T>,

Generate a random value in the given range. Read more
Source§

fn random_bool(&mut self, p: f64) -> bool

Return a bool with a probability p of being true. Read more
Source§

fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool

Return a bool with a probability of numerator/denominator of being true. Read more
Source§

fn sample<T, D>(&mut self, distr: D) -> T
where 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,

Create an iterator that generates values using the given distribution. Read more
Source§

fn fill<T>(&mut self, dest: &mut [T])
where T: Fill,

Fill any type implementing Fill with random data Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Threaded<T> for T

Source§

type Rest = ()

The outputs beyond the threaded value.
Source§

fn split(self) -> (T, ())

Splits into the threaded value and the extra outputs.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<R> TryRngCore for R
where R: TryRng,

Source§

type Error = <R as TryRng>::Error

👎Deprecated since 0.10.0:

use TryRng instead

Error type.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more