pub struct HarnessConfig { /* private fields */ }Expand description
Configuration shared by a process-local PostgreSQL test harness.
Implementations§
Source§impl HarnessConfig
impl HarnessConfig
pub fn new(project: impl Into<String>) -> Result<Self>
pub fn with_admin_database_url( self, admin_database_url: impl Into<String>, ) -> Self
Sourcepub fn with_image(self, image: impl Into<String>) -> Result<Self>
pub fn with_image(self, image: impl Into<String>) -> Result<Self>
Selects and validates the image used for owned-container startup.
The setting is retained but ignored for external-server startup,
including builds compiled without the containers feature.
Sourcepub fn with_owned_container_profile(
self,
profile: OwnedContainerProfile,
) -> Self
pub fn with_owned_container_profile( self, profile: OwnedContainerProfile, ) -> Self
Replaces the profile applied when this configuration starts an owned
container. External-server mode, including builds without the
containers feature, ignores the profile.
pub fn with_startup_timeout(self, timeout: Duration) -> Result<Self>
pub fn with_operation_timeout(self, timeout: Duration) -> Result<Self>
Sourcepub fn with_template_wait_timeout(self, timeout: Duration) -> Result<Self>
pub fn with_template_wait_timeout(self, timeout: Duration) -> Result<Self>
Sets how long a caller may wait for another process to initialize the same template. This is deliberately separate from the shorter timeout used by ordinary administrative operations.
pub fn with_stale_after(self, stale_after: Duration) -> Self
Sourcepub fn with_connection_budget(self, permits: usize) -> Result<Self>
pub fn with_connection_budget(self, permits: usize) -> Result<Self>
Overrides this harness’s connection budget. Repeated calls replace the previous override. If no per-database override is set, its default is clamped to this budget when the harness starts.
Sourcepub fn with_connections_per_database(self, permits: u32) -> Result<Self>
pub fn with_connections_per_database(self, permits: u32) -> Result<Self>
Overrides the permits held by each live database. Repeated calls replace the previous override. Its relationship to the final budget is order-independent and validated when the harness starts.
pub fn with_cleanup_on_start(self, cleanup_on_start: bool) -> Self
pub fn project(&self) -> &ProjectName
Sourcepub fn owned_container_profile(&self) -> &OwnedContainerProfile
pub fn owned_container_profile(&self) -> &OwnedContainerProfile
Returns the configured owned-container profile.
Sourcepub fn connection_limits(&self) -> Result<ConnectionLimits>
pub fn connection_limits(&self) -> Result<ConnectionLimits>
Resolves this configuration’s database connection-permit policy.
Resolution is order-independent. An explicit per-database value greater
than the final budget is reported here (and by
crate::PostgresHarness::start) because either builder may be called
first. When the per-database value is not overridden, its default is
clamped to a smaller budget.
Trait Implementations§
Source§impl Clone for HarnessConfig
impl Clone for HarnessConfig
Source§fn clone(&self) -> HarnessConfig
fn clone(&self) -> HarnessConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for HarnessConfig
impl RefUnwindSafe for HarnessConfig
impl Send for HarnessConfig
impl Sync for HarnessConfig
impl Unpin for HarnessConfig
impl UnsafeUnpin for HarnessConfig
impl UnwindSafe for HarnessConfig
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request