pub struct RevAllocator { /* private fields */ }Expand description
A session-wide revision counter. Every successful control
write allocates a fresh rev via Self::next.
Callers who build a session share one RevAllocator across
every Control in that session; the counter is strictly
increasing and usable for log ordering or reverse lookups.
When no explicit allocator is wired (e.g. tests, single-
purpose uses), a process-global allocator is available via
RevAllocator::global.
Implementations§
Source§impl RevAllocator
impl RevAllocator
pub fn new() -> Self
pub fn next(&self) -> u64
Sourcepub fn global() -> &'static Arc<RevAllocator> ⓘ
pub fn global() -> &'static Arc<RevAllocator> ⓘ
Shared allocator used when no session-scoped one is explicitly supplied. Useful for tests and for short-lived single-session processes — production runs should give each session its own allocator.
Trait Implementations§
Source§impl Debug for RevAllocator
impl Debug for RevAllocator
Auto Trait Implementations§
impl !Freeze for RevAllocator
impl RefUnwindSafe for RevAllocator
impl Send for RevAllocator
impl Sync for RevAllocator
impl Unpin for RevAllocator
impl UnsafeUnpin for RevAllocator
impl UnwindSafe for RevAllocator
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