pub struct OwnedContainerProfile { /* private fields */ }Expand description
Performance and storage behavior applied only to harness-owned containers.
The default profile is intended for disposable test data: it passes
--no-sync through the Docker Official PostgreSQL image’s
POSTGRES_INITDB_ARGS interface and mounts a size-bounded tmpfs at the
image’s PostgreSQL volume parent. External-server mode ignores this profile.
Custom images must implement the same environment-variable, filesystem, command, and mapped-TCP contracts as the Docker Official PostgreSQL 18 image. Disable either optimization when a compatible custom image or Docker daemon cannot provide it.
This type remains available without the containers feature so shared
configuration code can compile, but external-only startup ignores it.
Implementations§
Source§impl OwnedContainerProfile
impl OwnedContainerProfile
Sourcepub const fn performance() -> Self
pub const fn performance() -> Self
Returns the default disposable-data performance profile.
Sourcepub const fn with_initdb_no_sync(self, enabled: bool) -> Self
pub const fn with_initdb_no_sync(self, enabled: bool) -> Self
Enables or disables initdb --no-sync for an owned container.
Disable this for custom images that do not honor
POSTGRES_INITDB_ARGS. This does not affect the runtime PostgreSQL
durability settings used by the harness.
Sourcepub fn with_tmpfs_size_bytes(self, size_bytes: u64) -> Result<Self>
pub fn with_tmpfs_size_bytes(self, size_bytes: u64) -> Result<Self>
Sets the maximum number of bytes available to the owned container’s tmpfs-backed PostgreSQL storage.
Sourcepub const fn without_tmpfs(self) -> Self
pub const fn without_tmpfs(self) -> Self
Uses the image’s normal storage instead of adding a tmpfs mount.
This is the compatibility opt-out for daemons that do not support tmpfs mounts and for workloads that may exceed a safe memory-backed storage limit.
Sourcepub const fn initdb_no_sync(&self) -> bool
pub const fn initdb_no_sync(&self) -> bool
Reports whether the profile requests initdb --no-sync.
Sourcepub const fn tmpfs_size_bytes(&self) -> Option<u64>
pub const fn tmpfs_size_bytes(&self) -> Option<u64>
Reports the tmpfs size cap, or None when image-default storage is
selected.
Trait Implementations§
Source§impl Clone for OwnedContainerProfile
impl Clone for OwnedContainerProfile
Source§fn clone(&self) -> OwnedContainerProfile
fn clone(&self) -> OwnedContainerProfile
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for OwnedContainerProfile
Source§impl Debug for OwnedContainerProfile
impl Debug for OwnedContainerProfile
Source§impl Default for OwnedContainerProfile
impl Default for OwnedContainerProfile
impl Eq for OwnedContainerProfile
Source§impl PartialEq for OwnedContainerProfile
impl PartialEq for OwnedContainerProfile
impl StructuralPartialEq for OwnedContainerProfile
Auto Trait Implementations§
impl Freeze for OwnedContainerProfile
impl RefUnwindSafe for OwnedContainerProfile
impl Send for OwnedContainerProfile
impl Sync for OwnedContainerProfile
impl Unpin for OwnedContainerProfile
impl UnsafeUnpin for OwnedContainerProfile
impl UnwindSafe for OwnedContainerProfile
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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