pub struct Context { /* private fields */ }Expand description
Implementation of crate::Spawner, crate::Clock,
crate::Network, and crate::Storage for the deterministic
runtime.
Implementations§
Source§impl Context
impl Context
Sourcepub fn storage_audit(&self) -> [u8; 32]
pub fn storage_audit(&self) -> [u8; 32]
Compute a Sha256 digest of all storage contents.
Sourcepub fn storage_fault_config(&self) -> Arc<RwLock<FaultConfig>> ⓘ
pub fn storage_fault_config(&self) -> Arc<RwLock<FaultConfig>> ⓘ
Access the storage fault configuration.
Changes to the returned FaultConfig take effect immediately for
subsequent storage operations. This allows dynamically enabling or
disabling fault injection during a test.
Trait Implementations§
Source§impl BufferPooler for Context
impl BufferPooler for Context
Source§fn network_buffer_pool(&self) -> &BufferPool
fn network_buffer_pool(&self) -> &BufferPool
Source§fn storage_buffer_pool(&self) -> &BufferPool
fn storage_buffer_pool(&self) -> &BufferPool
Source§impl Clock for Context
impl Clock for Context
Source§fn current(&self) -> SystemTime
fn current(&self) -> SystemTime
Source§fn sleep(&self, duration: Duration) -> impl Future<Output = ()> + Send + 'static
fn sleep(&self, duration: Duration) -> impl Future<Output = ()> + Send + 'static
Source§fn sleep_until(
&self,
deadline: SystemTime,
) -> impl Future<Output = ()> + Send + 'static
fn sleep_until( &self, deadline: SystemTime, ) -> impl Future<Output = ()> + Send + 'static
Source§impl Network for Context
impl Network for Context
Source§impl ReasonablyRealtime for Context
impl ReasonablyRealtime for Context
Source§fn reference_point(&self) -> Self::Instant
fn reference_point(&self) -> Self::Instant
Source§impl Spawner for Context
impl Spawner for Context
Source§fn spawn<F, Fut, T>(self, f: F) -> Handle<T> ⓘ
fn spawn<F, Fut, T>(self, f: F) -> Handle<T> ⓘ
Source§async fn stop(self, value: i32, timeout: Option<Duration>) -> Result<(), Error>
async fn stop(self, value: i32, timeout: Option<Duration>) -> Result<(), Error>
Source§fn stopped(&self) -> Signal ⓘ
fn stopped(&self) -> Signal ⓘ
Source§impl Storage for Context
impl Storage for Context
Source§type Blob = <Storage<Storage<Storage<Storage>>> as Storage>::Blob
type Blob = <Storage<Storage<Storage<Storage>>> as Storage>::Blob
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>
Source§async fn remove(
&self,
partition: &str,
name: Option<&[u8]>,
) -> Result<(), Error>
async fn remove( &self, partition: &str, name: Option<&[u8]>, ) -> Result<(), Error>
Source§impl Strategizer for Context
Spawning threads would be nondeterministic, so the pool has no background workers. The
executor thread registers itself as its sole member and all work executes inline.
impl Strategizer for Context
Spawning threads would be nondeterministic, so the pool has no background workers. The executor thread registers itself as its sole member and all work executes inline.
Rayon’s current-thread registration is permanent and per-OS-thread, so only one pool can ever execute work on the executor thread. Every request (including from a later runner on the same thread) returns a strategy on that single-threaded pool with its planning parallelism set independently. This controls adaptive decisions and manual partitioning hints while Rayon executes on the sole registered thread. The returned strategy is therefore tied to the executor thread.
Source§impl Supervisor for Context
impl Supervisor for Context
impl TryCryptoRng for Context
Auto Trait Implementations§
impl !RefUnwindSafe for Context
impl !UnwindSafe for Context
impl Freeze for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnsafeUnpin for Context
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
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>
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>
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
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
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>,
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>,
Source§fn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
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
numerator/denominator of being
true. Read more