pub struct SimulatorResource { /* private fields */ }Expand description
A named, cooperative resource owner that a test can freeze independently.
This represents ownership/availability only. It deliberately does not provide a global service locator, connection pool, or implicit resource selection mechanism.
Implementations§
Source§impl SimulatorResource
impl SimulatorResource
Sourcepub async fn acquire(&self)
pub async fn acquire(&self)
Waits until this resource owner is available, then records one access.
Sourcepub fn freeze(&self) -> bool
pub fn freeze(&self) -> bool
Freezes future cooperative acquisitions of this specific owner.
Returns true only for the transition from available to frozen.
Sourcepub fn thaw(&self) -> bool
pub fn thaw(&self) -> bool
Makes this owner available and releases all currently blocked accessors.
Returns true only for the transition from frozen to available.
Sourcepub fn acquisition_count(&self) -> usize
pub fn acquisition_count(&self) -> usize
Returns the number of completed cooperative acquisitions.
Trait Implementations§
Source§impl Clone for SimulatorResource
impl Clone for SimulatorResource
Auto Trait Implementations§
impl !RefUnwindSafe for SimulatorResource
impl !Send for SimulatorResource
impl !Sync for SimulatorResource
impl !UnwindSafe for SimulatorResource
impl Freeze for SimulatorResource
impl Unpin for SimulatorResource
impl UnsafeUnpin for SimulatorResource
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