Skip to content

Commit 876fd31

Browse files
committed
docs: add documentation for CommandExecutor
1 parent 6ebc1c4 commit 876fd31

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

postgresql_embedded/src/command/traits.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,15 @@ impl CommandToString for tokio::process::Command {
7373
}
7474
}
7575

76+
/// Interface for executing a command
7677
pub trait CommandExecutor {
78+
/// Execute the command and return the stdout and stderr
7779
async fn execute(&mut self, timeout: Option<Duration>) -> Result<(String, String)>;
7880
}
7981

8082
/// Implement the [`CommandExecutor`] trait for [`Command`](std::process::Command)
8183
impl CommandExecutor for std::process::Command {
84+
/// Execute the command and return the stdout and stderr
8285
async fn execute(&mut self, _timeout: Option<Duration>) -> Result<(String, String)> {
8386
debug!("Executing command: {}", self.to_command_string());
8487
self.stdout(Stdio::piped());
@@ -108,6 +111,7 @@ impl CommandExecutor for std::process::Command {
108111
#[cfg(feature = "tokio")]
109112
/// Implement the [`CommandExecutor`] trait for [`Command`](tokio::process::Command)
110113
impl CommandExecutor for tokio::process::Command {
114+
/// Execute the command and return the stdout and stderr
111115
async fn execute(&mut self, timeout: Option<Duration>) -> Result<(String, String)> {
112116
debug!("Executing command: {}", self.to_command_string());
113117
self.stdout(Stdio::piped());

0 commit comments

Comments
 (0)