pub struct SuiteFixtureLock { /* private fields */ }Expand description
Exclusive lock and atomic state file for one suite fixture.
Keep this guard for the complete validate-or-rebuild transaction. A producer that exits before
Self::publish leaves no visible fixture state, so the next process can safely clean the
product’s deterministic candidate resource and rebuild it.
Implementations§
Source§impl SuiteFixtureLock
impl SuiteFixtureLock
Sourcepub fn acquire(suite: &TestContainerSuite, fixture: &str) -> Self
pub fn acquire(suite: &TestContainerSuite, fixture: &str) -> Self
Acquires the cross-process lock for one suite fixture.
§Panics
Panics when the fixture name is invalid or the lock file cannot be opened or locked.
Sourcepub fn load(&self) -> Option<SuiteFixtureState>
pub fn load(&self) -> Option<SuiteFixtureState>
Loads the last fully published state, or None when no fixture has been published.
§Panics
Panics when state cannot be read, decoded, or validated.
Sourcepub fn publish(&self, state: &SuiteFixtureState)
pub fn publish(&self, state: &SuiteFixtureState)
Atomically publishes a completed fixture state while this guard is held.
§Panics
Panics when state is invalid or its temporary file cannot be written or published.
Auto Trait Implementations§
impl Freeze for SuiteFixtureLock
impl RefUnwindSafe for SuiteFixtureLock
impl Send for SuiteFixtureLock
impl Sync for SuiteFixtureLock
impl Unpin for SuiteFixtureLock
impl UnwindSafe for SuiteFixtureLock
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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 more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].