pub struct PostgresBuilder { /* private fields */ }Expand description
Builder for a postgres instance.
Usually constructed via Postgres::build.
Implementations§
Source§impl PostgresBuilder
impl PostgresBuilder
Sourcepub fn data_dir<T: Into<PathBuf>>(&mut self, data_dir: T) -> &mut Self
pub fn data_dir<T: Into<PathBuf>>(&mut self, data_dir: T) -> &mut Self
Sets the postgres data directory.
If not set, a temporary directory will be used.
Sourcepub fn initdb_binary<T: Into<PathBuf>>(&mut self, initdb_binary: T) -> &mut Self
pub fn initdb_binary<T: Into<PathBuf>>(&mut self, initdb_binary: T) -> &mut Self
Sets the location of the initdb binary.
Sourcepub fn port(&mut self, port: u16) -> &mut Self
pub fn port(&mut self, port: u16) -> &mut Self
Sets listening port.
If no port is set, the builder will attempt to find an unused port through binding to port 0. This
is somewhat racy, but the only recourse, since Postgres does not support binding to port
0.
Sourcepub fn postgres_binary<T: Into<PathBuf>>(
&mut self,
postgres_binary: T,
) -> &mut Self
pub fn postgres_binary<T: Into<PathBuf>>( &mut self, postgres_binary: T, ) -> &mut Self
Sets the location of the postgres binary.
Sourcepub fn probe_delay(&mut self, probe_delay: Duration) -> &mut Self
pub fn probe_delay(&mut self, probe_delay: Duration) -> &mut Self
Sets the startup probe delay.
Between two startup probes, waits this long.
Sourcepub fn psql_binary<T: Into<PathBuf>>(&mut self, psql_binary: T) -> &mut Self
pub fn psql_binary<T: Into<PathBuf>>(&mut self, psql_binary: T) -> &mut Self
Sets the location of the psql binary.
Sourcepub fn startup_timeout(&mut self, startup_timeout: Duration) -> &mut Self
pub fn startup_timeout(&mut self, startup_timeout: Duration) -> &mut Self
Sets the maximum time to probe for startup.
Sourcepub fn superuser_pw<T: Into<String>>(&mut self, superuser_pw: T) -> &mut Self
pub fn superuser_pw<T: Into<String>>(&mut self, superuser_pw: T) -> &mut Self
Sets the password for the superuser.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PostgresBuilder
impl RefUnwindSafe for PostgresBuilder
impl Send for PostgresBuilder
impl Sync for PostgresBuilder
impl Unpin for PostgresBuilder
impl UnwindSafe for PostgresBuilder
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
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