pub struct MemoryDispenser { /* private fields */ }Expand description
A simple in-memory dispenser for testing and single-session use. Not persistent — loses state on drop.
Implementations§
Source§impl MemoryDispenser
impl MemoryDispenser
Sourcepub fn with_state(state: DispenserState) -> Self
pub fn with_state(state: DispenserState) -> Self
Create with pre-loaded state (e.g., from a file).
Trait Implementations§
Source§impl Dispenser for MemoryDispenser
impl Dispenser for MemoryDispenser
Source§fn next(&self, object_type: &str) -> Result<u32>
fn next(&self, object_type: &str) -> Result<u32>
Get the next sequence number for the given object type.
Increments the counter atomically.
Source§fn peek(&self, object_type: &str) -> Result<u32>
fn peek(&self, object_type: &str) -> Result<u32>
Peek at the next sequence number without incrementing.
Source§fn state(&self) -> Result<DispenserState>
fn state(&self) -> Result<DispenserState>
Get the full current state (all counters).
Auto Trait Implementations§
impl !Freeze for MemoryDispenser
impl RefUnwindSafe for MemoryDispenser
impl Send for MemoryDispenser
impl Sync for MemoryDispenser
impl Unpin for MemoryDispenser
impl UnsafeUnpin for MemoryDispenser
impl UnwindSafe for MemoryDispenser
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