pub struct MysqlTestContainer { /* private fields */ }Expand description
Handle to the suite’s shared MySQL container.
Implementations§
Source§impl MysqlTestContainer
impl MysqlTestContainer
Sourcepub async fn start(suite: &TestContainerSuite) -> Self
pub async fn start(suite: &TestContainerSuite) -> Self
Starts (or reuses) the shared MySQL container with root/rootpass credentials.
§Panics
Panics when shared state, container startup, port discovery, readiness connection, or readiness connection shutdown fails.
Sourcepub fn container_identity(&self) -> &str
pub fn container_identity(&self) -> &str
Returns a stable identity for the running suite container.
Sourcepub fn database_url(&self, database: &str) -> String
pub fn database_url(&self, database: &str) -> String
Builds a URL for a database created inside this container.
Sourcepub fn stale_resources(&self) -> &[String]
pub fn stale_resources(&self) -> &[String]
Returns resources left by test processes that no longer exist.
Sourcepub fn remember_resource(&self, resource: &str)
pub fn remember_resource(&self, resource: &str)
Registers a product-owned resource, such as a per-test database name.
Sourcepub fn forget_resource(&self, resource: &str)
pub fn forget_resource(&self, resource: &str)
Removes a resource after the product test harness cleaned it up.
Sourcepub fn forget_resources(&self, resources: &[String])
pub fn forget_resources(&self, resources: &[String])
Removes multiple resources after the product test harness cleaned all of them up.
Registers a suite-scoped product fixture that must outlive the producer process.
This is for product-owned migrated template schemas. Products must pair it with their own
fingerprint-based invalidation and call Self::forget_shared_resource after dropping a
superseded fixture.
Removes a suite-scoped product fixture after it was explicitly cleaned up.
Creates a suite-scoped database for a product-owned reusable fixture.
Products own user grants, migrations, and fingerprint validation. This helper owns only the root-level database lifecycle and shared-resource registration.
§Panics
Panics when the name is invalid or database creation, connection, or shutdown fails.
Drops a suite-scoped fixture database and unregisters it.
§Panics
Panics when the name is invalid or database cleanup, connection, or shutdown fails.
Auto Trait Implementations§
impl Freeze for MysqlTestContainer
impl !RefUnwindSafe for MysqlTestContainer
impl Send for MysqlTestContainer
impl Sync for MysqlTestContainer
impl Unpin for MysqlTestContainer
impl !UnwindSafe for MysqlTestContainer
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
§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>
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>
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>
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>,
Layered].