use alloc::string::String;
use crate::{bolts::tuples::Named, observers::Observer};
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct StdOutObserver {
pub name: String,
pub stdout: Option<String>,
}
impl StdOutObserver {
#[must_use]
pub fn new(name: String) -> Self {
Self { name, stdout: None }
}
}
impl<I, S> Observer<I, S> for StdOutObserver {}
impl Named for StdOutObserver {
fn name(&self) -> &str {
&self.name
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct StdErrObserver {
pub name: String,
pub stderr: Option<String>,
}
impl StdErrObserver {
#[must_use]
pub fn new(name: String) -> Self {
Self { name, stderr: None }
}
}
impl<I, S> Observer<I, S> for StdErrObserver {}
impl Named for StdErrObserver {
fn name(&self) -> &str {
&self.name
}
}