pub struct Runtime {
pub bindir: PathBuf,
pub version: Version,
}
Fields§
§bindir: PathBuf
Path to the directory containing the pg_ctl
executable and other
PostgreSQL binaries.
version: Version
Version of this runtime.
Implementations§
source§impl Runtime
impl Runtime
pub fn new<P: AsRef<Path>>(bindir: P) -> Result<Self, RuntimeError>
sourcepub fn execute<T: AsRef<OsStr>>(&self, program: T) -> Command
pub fn execute<T: AsRef<OsStr>>(&self, program: T) -> Command
Return a Command
prepped to run the given program
in this
PostgreSQL runtime.
let version = runtime.execute("pg_ctl").arg("--version").output()?;
Panics
Panics if it’s not possible to calculate PATH
; see
env::join_paths
.
sourcepub fn command<T: AsRef<OsStr>>(&self, program: T) -> Command
pub fn command<T: AsRef<OsStr>>(&self, program: T) -> Command
Return a Command
prepped to run the given program
with this
PostgreSQL runtime at the front of PATH
. This is very similar to
Self::execute
except it does not qualify the given program name with
Self::bindir
.
let version = runtime.command("bash").arg("-c").arg("echo hello").output();
Panics
Panics if it’s not possible to calculate PATH
; see
env::join_paths
.
Trait Implementations§
source§impl PartialEq for Runtime
impl PartialEq for Runtime
source§impl Strategy for Runtime
impl Strategy for Runtime
Use a single runtime as a strategy.
impl Eq for Runtime
impl StructuralEq for Runtime
impl StructuralPartialEq for Runtime
Auto Trait Implementations§
impl RefUnwindSafe for Runtime
impl Send for Runtime
impl Sync for Runtime
impl Unpin for Runtime
impl UnwindSafe for Runtime
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