pub struct GroupDisplay<K, W, S: EngineSpec> { /* private fields */ }Expand description
A displayer that simultaneously manages and shows line-based output for several event buffers.
K is the key type for each element in the group. Its fmt::Display impl
is called to obtain the prefix, and Eq + Ord is used for keys.
Implementations§
Source§impl<K: Eq + Ord, W: Write, S: EngineSpec> GroupDisplay<K, W, S>
impl<K: Eq + Ord, W: Write, S: EngineSpec> GroupDisplay<K, W, S>
Sourcepub fn new<Str>(
log: &Logger,
keys_and_prefixes: impl IntoIterator<Item = (K, Str)>,
writer: W,
) -> Self
pub fn new<Str>( log: &Logger, keys_and_prefixes: impl IntoIterator<Item = (K, Str)>, writer: W, ) -> Self
Creates a new GroupDisplay with the provided report keys and
prefixes.
The function passed in is expected to create a writer.
Sourcepub fn new_with_display(
log: &Logger,
keys: impl IntoIterator<Item = K>,
writer: W,
) -> Selfwhere
K: Display,
pub fn new_with_display(
log: &Logger,
keys: impl IntoIterator<Item = K>,
writer: W,
) -> Selfwhere
K: Display,
Creates a new GroupDisplay with the provided report keys, using the
Display impl to obtain the respective prefixes.
Sourcepub fn set_styles(&mut self, styles: LineDisplayStyles)
pub fn set_styles(&mut self, styles: LineDisplayStyles)
Sets the styles for all future lines.
Sourcepub fn set_start_time(&mut self, start_time: DateTime<Utc>)
pub fn set_start_time(&mut self, start_time: DateTime<Utc>)
Sets the start time for all future lines.
If the start time is set, the progress display will be relative to that time. Otherwise, only the offset from the start of the job will be displayed.
Sourcepub fn set_progress_interval(&mut self, interval: Duration)
pub fn set_progress_interval(&mut self, interval: Duration)
Sets the amount of time before new progress events are shown.
Sourcepub fn contains_key<Q>(&self, key: &Q) -> bool
pub fn contains_key<Q>(&self, key: &Q) -> bool
Returns true if this GroupDisplay is producing reports corresponding
to the given key.
Sourcepub fn add_event_report<Q>(
&mut self,
key: &Q,
event_report: EventReport<S>,
) -> Result<(), UnknownReportKey>
pub fn add_event_report<Q>( &mut self, key: &Q, event_report: EventReport<S>, ) -> Result<(), UnknownReportKey>
Adds an event report to the display, keyed by the index, and updates internal state.
Returns Ok(()) if the report was accepted because the key was
known to this GroupDisplay, and an error if it was not.
Sourcepub fn write_stats(&mut self, header: &str) -> Result<()>
pub fn write_stats(&mut self, header: &str) -> Result<()>
Writes a “Status” or “Summary” line to the writer with statistics.
Sourcepub fn write_events(&mut self) -> Result<()>
pub fn write_events(&mut self) -> Result<()>
Writes all pending events to the writer.
Sourcepub fn stats(&self) -> &GroupDisplayStats
pub fn stats(&self) -> &GroupDisplayStats
Returns the current statistics for this GroupDisplay.
Trait Implementations§
Auto Trait Implementations§
impl<K, W, S> Freeze for GroupDisplay<K, W, S>where
W: Freeze,
impl<K, W, S> RefUnwindSafe for GroupDisplay<K, W, S>where
W: RefUnwindSafe,
K: RefUnwindSafe,
<S as EngineSpec>::ProgressMetadata: RefUnwindSafe,
<S as EngineSpec>::StepId: RefUnwindSafe,
<S as EngineSpec>::Component: RefUnwindSafe,
<S as EngineSpec>::StepMetadata: RefUnwindSafe,
<S as EngineSpec>::CompletionMetadata: RefUnwindSafe,
<S as EngineSpec>::SkippedMetadata: RefUnwindSafe,
impl<K, W, S> Send for GroupDisplay<K, W, S>
impl<K, W, S> Sync for GroupDisplay<K, W, S>
impl<K, W, S> Unpin for GroupDisplay<K, W, S>where
W: Unpin,
impl<K, W, S> UnsafeUnpin for GroupDisplay<K, W, S>where
W: UnsafeUnpin,
impl<K, W, S> UnwindSafe for GroupDisplay<K, W, S>where
W: UnwindSafe,
K: RefUnwindSafe,
<S as EngineSpec>::ProgressMetadata: RefUnwindSafe,
<S as EngineSpec>::StepId: RefUnwindSafe,
<S as EngineSpec>::Component: RefUnwindSafe,
<S as EngineSpec>::StepMetadata: RefUnwindSafe,
<S as EngineSpec>::CompletionMetadata: RefUnwindSafe,
<S as EngineSpec>::SkippedMetadata: RefUnwindSafe,
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
Source§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more