1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
use super::stream;
use crate::{component, Application, Component, FrameworkError, Version};
use std::fmt;
use termcolor::ColorChoice;
pub struct TerminalComponent {}
impl TerminalComponent {
pub fn new(color_choice: ColorChoice) -> TerminalComponent {
stream::set_color_choice(color_choice);
Self {}
}
}
impl<A> Component<A> for TerminalComponent
where
A: Application,
{
fn name(&self) -> component::Name {
component::Name("abscissa_core::terminal")
}
fn version(&self) -> Version {
Version::new(0, 0, 0)
}
fn after_config(&mut self, _config: &A::Cfg) -> Result<(), FrameworkError> {
Ok(())
}
}
impl fmt::Debug for TerminalComponent {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "TerminalComponent {{ stdout, stderr }}")
}
}