pub struct DelayedSyncContext<E> {
pub inner: E,
pub pending: PendingSyncs,
}Expand description
Context wrapper whose blobs defer Blob::start_sync and can gate blocking syncs in tests.
Fields§
§inner: E§pending: PendingSyncsTrait Implementations§
Source§impl<E: BufferPooler> BufferPooler for DelayedSyncContext<E>
impl<E: BufferPooler> BufferPooler for DelayedSyncContext<E>
Source§fn network_buffer_pool(&self) -> &BufferPool
fn network_buffer_pool(&self) -> &BufferPool
Returns the network BufferPool.
Source§fn storage_buffer_pool(&self) -> &BufferPool
fn storage_buffer_pool(&self) -> &BufferPool
Returns the storage BufferPool.
Source§impl<E: Clock> Clock for DelayedSyncContext<E>
impl<E: Clock> Clock for DelayedSyncContext<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
fn sleep(&self, duration: Duration) -> impl Future<Output = ()> + Send + 'static
Sleep for the given duration.
Source§fn sleep_until(
&self,
deadline: SystemTime,
) -> impl Future<Output = ()> + Send + 'static
fn sleep_until( &self, deadline: SystemTime, ) -> impl Future<Output = ()> + Send + 'static
Sleep until the given deadline.
Source§impl<E: Clock> Clock for DelayedSyncContext<E>
impl<E: Clock> Clock for DelayedSyncContext<E>
Source§impl<E: Clone> Clone for DelayedSyncContext<E>
impl<E: Clone> Clone for DelayedSyncContext<E>
Source§fn clone(&self) -> DelayedSyncContext<E>
fn clone(&self) -> DelayedSyncContext<E>
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<E: Metrics> Metrics for DelayedSyncContext<E>
impl<E: Metrics> Metrics for DelayedSyncContext<E>
Source§impl<E: Clock> ReasonablyRealtime for DelayedSyncContext<E>
impl<E: Clock> ReasonablyRealtime for DelayedSyncContext<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 DelayedSyncContext<E>
impl<E: Spawner> Spawner for DelayedSyncContext<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 DelayedSyncContext<E>
impl<E: Storage> Storage for DelayedSyncContext<E>
Source§type Blob = DelayedSyncBlob<<E as Storage>::Blob>
type Blob = DelayedSyncBlob<<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<u16>,
) -> Result<(Self::Blob, u64, u16), Error>
async fn open_versioned( &self, partition: &str, name: &[u8], versions: RangeInclusive<u16>, ) -> Result<(Self::Blob, u64, u16), 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 DelayedSyncContext<E>
impl<E: Supervisor> Supervisor for DelayedSyncContext<E>
impl<E: TryCryptoRng> TryCryptoRng for DelayedSyncContext<E>
Source§impl<E: TryRng> TryRng for DelayedSyncContext<E>
impl<E: TryRng> TryRng for DelayedSyncContext<E>
Auto Trait Implementations§
impl<E> !RefUnwindSafe for DelayedSyncContext<E>
impl<E> !UnwindSafe for DelayedSyncContext<E>
impl<E> Freeze for DelayedSyncContext<E>where
E: Freeze,
impl<E> Send for DelayedSyncContext<E>where
E: Send,
impl<E> Sync for DelayedSyncContext<E>where
E: Sync,
impl<E> Unpin for DelayedSyncContext<E>where
E: Unpin,
impl<E> UnsafeUnpin for DelayedSyncContext<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
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<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