pub struct ProcessGuard {
pub stdout_reader: Option<Lines<BufReader<ChildStdout>>>,
pub stderr_reader: Option<Lines<BufReader<ChildStderr>>>,
pub port: u32,
pub db_name: String,
pub user_name: String,
/* private fields */
}
Expand description
ProcessGuard
represents a postgresql process that is running in the background.
once the guard is dropped the process will be killed.
Fields§
§stdout_reader: Option<Lines<BufReader<ChildStdout>>>
Allows users to read stdout by line for debugging.
stderr_reader: Option<Lines<BufReader<ChildStderr>>>
Allows users to read stderr by line for debugging.
port: u32
Parameters for connecting to the temporary postgresql instance.
A user shouldn’t need to use these and should call connection_string
instead.
Port number that Postgresql is serving on
db_name: String
Database name to connect to.
user_name: String
Username to connect as.
Implementations§
Source§impl ProcessGuard
impl ProcessGuard
Sourcepub fn connection_string(&self) -> String
pub fn connection_string(&self) -> String
Get a Postgresql format connection String for the process guard.
§Panics
Panics if a string file path cannot be obtained from the socket directory.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProcessGuard
impl RefUnwindSafe for ProcessGuard
impl Send for ProcessGuard
impl Sync for ProcessGuard
impl Unpin for ProcessGuard
impl UnwindSafe for ProcessGuard
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> 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>
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