pub struct OperationContext { /* private fields */ }Expand description
Immutable environment captured at the start of one operation.
Implementations§
Source§impl OperationContext
impl OperationContext
pub const fn unix_millis(&self) -> i64
pub const fn clock_source(&self) -> RuntimeValueSource
pub const fn today_local(&self) -> CivilDate
pub const fn today_is_fixed(&self) -> bool
pub fn local_time_zone(&self) -> &LocalTimeZone
pub const fn seed(&self) -> u64
pub const fn random_source(&self) -> RuntimeValueSource
pub fn timing(&self) -> Option<OperationTiming>
pub fn require_timing( &self, ) -> Result<OperationTiming, OperationTimingUnavailable>
Sourcepub fn derive_u64(&self, domain: &str, ordinal: u64) -> u64
pub fn derive_u64(&self, domain: &str, ordinal: u64) -> u64
Derives a stable value from this operation’s random key without sharing mutable PRNG state.
Callers must use a durable, owner-qualified domain such as block.generated-id. The
ordinal is local to that domain, so adding random consumers in another family cannot shift
existing output.
pub fn derive_nonzero_u64(&self, domain: &str, ordinal: u64) -> NonZeroU64
pub fn derive_hex(&self, domain: &str, ordinal: u64, len: usize) -> String
Trait Implementations§
Source§impl Clone for OperationContext
impl Clone for OperationContext
Source§impl Debug for OperationContext
impl Debug for OperationContext
impl Eq for OperationContext
Source§impl PartialEq for OperationContext
impl PartialEq for OperationContext
impl StructuralPartialEq for OperationContext
Auto Trait Implementations§
impl Freeze for OperationContext
impl RefUnwindSafe for OperationContext
impl Send for OperationContext
impl Sync for OperationContext
impl Unpin for OperationContext
impl UnsafeUnpin for OperationContext
impl UnwindSafe for OperationContext
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.