Struct zebra_test::command::TestChild

source ·
pub struct TestChild<T> {
    pub dir: Option<T>,
    pub cmd: String,
    pub command_path: String,
    pub child: Option<Child>,
    pub stdout: Option<Box<dyn IteratorDebug<Item = Result<String>> + Send>>,
    pub stderr: Option<Box<dyn IteratorDebug<Item = Result<String>> + Send>>,
    failure_regexes: RegexSet,
    ignore_regexes: RegexSet,
    pub deadline: Option<Instant>,
    pub timeout: Option<Duration>,
    bypass_test_capture: bool,
}
Expand description

A test command child process.

Fields§

§dir: Option<T>

The working directory of the command.

None when the command has been waited on, and its output has been taken.

§cmd: String

The full command string, including arguments and working directory.

§command_path: String

The path of the command, as passed to spawn2().

§child: Option<Child>

The child process itself.

None when the command has been waited on, and its output has been taken.

§stdout: Option<Box<dyn IteratorDebug<Item = Result<String>> + Send>>

The standard output stream of the child process.

TODO: replace with `Option<ChildOutput { stdout, stderr }>.

§stderr: Option<Box<dyn IteratorDebug<Item = Result<String>> + Send>>

The standard error stream of the child process.

§failure_regexes: RegexSet

Command outputs which indicate test failure.

This list of regexes is matches against stdout or stderr, in every method that reads command output.

If any line matches any failure regex, the test fails.

§ignore_regexes: RegexSet

Command outputs which are ignored when checking for test failure. These regexes override failure_regexes.

This list of regexes is matches against stdout or stderr, in every method that reads command output.

If a line matches any ignore regex, the failure regex check is skipped for that line.

§deadline: Option<Instant>

The deadline for this command to finish.

Only checked when the command outputs each new line (#1140).

§timeout: Option<Duration>

The timeout for this command to finish.

Only used for debugging output.

§bypass_test_capture: bool

If true, write child output directly to standard output, bypassing the Rust test harness output capture.

Implementations§

source§

impl<T> TestChild<T>

source

pub fn with_failure_regex_set<F, X>( self, failure_regexes: F, ignore_regexes: X, ) -> Self
where F: ToRegexSet, X: ToRegexSet,

Sets up command output so each line is checked against a failure regex set, unless it matches any of the ignore regexes.

The failure regexes are ignored by wait_with_output.

To never match any log lines, use RegexSet::empty().

This method is a TestChild::with_failure_regexes wrapper for strings, Regexes, and [RegexSet]s.

§Panics
  • adds a panic to any method that reads output, if any stdout or stderr lines match any failure regex
source

pub fn with_failure_regex_iter<F, X>( self, failure_regexes: F, ignore_regexes: X, ) -> Self

Sets up command output so each line is checked against a failure regex set, unless it matches any of the ignore regexes.

The failure regexes are ignored by wait_with_output.

To never match any log lines, use NO_MATCHES_REGEX_ITER.

This method is a TestChild::with_failure_regexes wrapper for regular expression iterators.

§Panics
  • adds a panic to any method that reads output, if any stdout or stderr lines match any failure regex
source

pub fn with_failure_regexes( self, failure_regexes: RegexSet, ignore_regexes: impl Into<Option<RegexSet>>, ) -> Self

Sets up command output so each line is checked against a failure regex set, unless it matches any of the ignore regexes.

The failure regexes are ignored by wait_with_output.

§Panics
  • adds a panic to any method that reads output, if any stdout or stderr lines match any failure regex
source

pub fn apply_failure_regexes_to_outputs(&mut self)

Applies the failure and ignore regex sets to command output.

The failure regexes are ignored by wait_with_output.

§Panics
  • adds a panic to any method that reads output, if any stdout or stderr lines match any failure regex
source

fn map_into_string_lines<R>( &self, reader: R, ) -> Box<dyn IteratorDebug<Item = Result<String>> + Send>
where R: Read + Debug + Send + 'static,

Maps a reader into a string line iterator, and applies the failure and ignore regex sets to it.

source

pub fn kill(&mut self, ignore_exited: bool) -> Result<()>

Kill the child process.

If ignore_exited is true, log “can’t kill an exited process” errors, rather than returning them.

Returns the result of the kill.

§BUGS

On Windows (and possibly macOS), this function can return Ok for processes that have panicked. See #1781.

source

pub fn kill_and_consume_output(&mut self, ignore_exited: bool) -> Result<()>

Kill the process, and consume all its remaining output.

If ignore_exited is true, log “can’t kill an exited process” errors, rather than returning them.

Returns the result of the kill.

source

pub fn kill_and_return_output(&mut self, ignore_exited: bool) -> Result<String>

Kill the process, and return all its remaining standard output and standard error output.

If ignore_exited is true, log “can’t kill an exited process” errors, rather than returning them.

Returns Ok(output), or an error if the kill failed.

source

pub fn wait_for_stdout_line<OptS>(&mut self, write_context: OptS) -> bool
where OptS: Into<Option<String>>,

Waits until a line of standard output is available, then consumes it.

If there is a line, and write_context is Some, writes the context to the test logs. Always writes the line to the test logs.

Returns true if a line was available, or false if the standard output has finished.

source

pub fn wait_for_stderr_line<OptS>(&mut self, write_context: OptS) -> bool
where OptS: Into<Option<String>>,

Waits until a line of standard error is available, then consumes it.

If there is a line, and write_context is Some, writes the context to the test logs. Always writes the line to the test logs.

Returns true if a line was available, or false if the standard error has finished.

source

fn wait_and_return_output_line( output: impl Iterator<Item = Result<String>>, bypass_test_capture: bool, ) -> Option<String>

Waits until a line of output is available, then returns it.

If there is a line, and write_context is Some, writes the context to the test logs. Always writes the line to the test logs.

Returns true if a line was available, or false if the standard output has finished.

source

pub fn wait_with_output(self) -> Result<TestOutput<T>>

Waits for the child process to exit, then returns its output.

§Correctness

The other test child output methods take one or both outputs, making them unavailable to this method.

Ignores any configured timeouts.

Returns an error if the child has already been taken. TODO: return an error if both outputs have already been taken.

source

pub fn with_timeout(self, timeout: Duration) -> Self

Set a timeout for expect_stdout_line_matches or expect_stderr_line_matches.

Does not apply to wait_with_output.

source

pub fn bypass_test_capture(self, cond: bool) -> Self

Configures this test runner to forward stdout and stderr to the true stdout, rather than the fakestdout used by cargo tests.

source

pub fn expect_stdout_line_matches<R>( &mut self, success_regex: R, ) -> Result<String>
where R: ToRegexSet + Debug,

Checks each line of the child’s stdout against any regex in success_regex, and returns the first matching line. Prints all stdout lines.

Kills the child on error, or after the configured timeout has elapsed. See Self::expect_line_matching_regex_set for details.

source

pub fn expect_stderr_line_matches<R>( &mut self, success_regex: R, ) -> Result<String>
where R: ToRegexSet + Debug,

Checks each line of the child’s stderr against any regex in success_regex, and returns the first matching line. Prints all stderr lines to stdout.

Kills the child on error, or after the configured timeout has elapsed. See Self::expect_line_matching_regex_set for details.

source

pub fn expect_stdout_line_matches_all_unordered<RegexList>( &mut self, unordered_regexes: RegexList, ) -> Result<Vec<String>>
where RegexList: IntoIterator + Debug, RegexList::Item: ToRegexSet,

Checks each line of the child’s stdout, until it finds every regex in unordered_regexes, and returns all lines matched by any regex, until each regex has been matched at least once. If the output finishes or the command times out before all regexes are matched, returns an error with a list of unmatched regexes. Prints all stdout lines.

Kills the child on error, or after the configured timeout has elapsed. See Self::expect_line_matching_regex_set for details.

source

pub fn expect_stderr_line_matches_all_unordered<RegexList>( &mut self, unordered_regexes: RegexList, ) -> Result<Vec<String>>
where RegexList: IntoIterator + Debug, RegexList::Item: ToRegexSet,

Checks each line of the child’s stderr, until it finds every regex in unordered_regexes, and returns all lines matched by any regex, until each regex has been matched at least once. If the output finishes or the command times out before all regexes are matched, returns an error with a list of unmatched regexes. Prints all stderr lines.

Kills the child on error, or after the configured timeout has elapsed. See Self::expect_line_matching_regex_set for details.

source

pub fn expect_stdout_line_matches_silent<R>( &mut self, success_regex: R, ) -> Result<String>
where R: ToRegexSet + Debug,

Checks each line of the child’s stdout against success_regex, and returns the first matching line. Does not print any output.

Kills the child on error, or after the configured timeout has elapsed. See Self::expect_line_matching_regex_set for details.

source

pub fn expect_stderr_line_matches_silent<R>( &mut self, success_regex: R, ) -> Result<String>
where R: ToRegexSet + Debug,

Checks each line of the child’s stderr against success_regex, and returns the first matching line. Does not print any output.

Kills the child on error, or after the configured timeout has elapsed. See Self::expect_line_matching_regex_set for details.

source

pub fn expect_line_matching_regex_set<L, R>( &mut self, lines: &mut L, success_regexes: R, stream_name: &str, write_to_logs: bool, ) -> Result<String>
where L: Iterator<Item = Result<String>>, R: ToRegexSet,

Checks each line in lines against a regex set, and returns Ok if a line matches.

Self::expect_line_matching_regexes wrapper for strings, Regexes, and [RegexSet]s.

source

pub fn expect_line_matching_regex_iter<L, I>( &mut self, lines: &mut L, success_regexes: I, stream_name: &str, write_to_logs: bool, ) -> Result<String>
where L: Iterator<Item = Result<String>>, I: CollectRegexSet,

Checks each line in lines against a regex set, and returns Ok if a line matches.

Self::expect_line_matching_regexes wrapper for regular expression iterators.

source

pub fn expect_line_matching_regexes<L>( &mut self, lines: &mut L, success_regexes: RegexSet, stream_name: &str, write_to_logs: bool, ) -> Result<String>
where L: Iterator<Item = Result<String>>,

Checks each line in lines against success_regexes, and returns Ok if a line matches. Uses stream_name as the name for lines in error reports.

Kills the child on error, or after the configured timeout has elapsed.

Note: the timeout is only checked after each full line is received from the child (#1140).

source

fn write_to_test_logs<S>(line: S, bypass_test_capture: bool)
where S: AsRef<str>,

Write line to stdout, so it can be seen in the test logs.

Use bypass_test_capture(true) or cargo test -- --nocapture to see this output.

May cause weird reordering for stdout / stderr. Uses stdout even if the original lines were from stderr.

source

pub fn kill_on_error<V, E>( self, result: Result<V, E>, ) -> Result<(V, Self), Report>
where E: Into<Report> + Send + Sync + 'static,

Kill child, wait for its output, and use that output as the context for an error report based on error.

source

fn past_deadline(&self) -> bool

source

pub fn is_running(&mut self) -> bool

Is this process currently running?

§Bugs

On Windows and macOS, this function can return true for processes that have panicked. See #1781.

§Panics

If the child process was already been taken using wait_with_output.

Trait Implementations§

source§

impl<T> AsMut<TestChild<T>> for TestChild<T>

source§

fn as_mut(&mut self) -> &mut Self

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T> AsRef<TestChild<T>> for TestChild<T>

source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> ContextFrom<&mut TestChild<T>> for Report

source§

type Return = Report

source§

fn context_from(self, source: &mut TestChild<T>) -> Self::Return

source§

impl<T: Debug> Debug for TestChild<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> Drop for TestChild<T>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<T> Freeze for TestChild<T>
where T: Freeze,

§

impl<T> !RefUnwindSafe for TestChild<T>

§

impl<T> Send for TestChild<T>
where T: Send,

§

impl<T> !Sync for TestChild<T>

§

impl<T> Unpin for TestChild<T>
where T: Unpin,

§

impl<T> !UnwindSafe for TestChild<T>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<D> OwoColorize for D

§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
§

fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>

Change the foreground color to black
§

fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>

Change the background color to black
§

fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>

Change the foreground color to red
§

fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>

Change the background color to red
§

fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>

Change the foreground color to green
§

fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>

Change the background color to green
§

fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>

Change the foreground color to yellow
§

fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>

Change the background color to yellow
§

fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>

Change the foreground color to blue
§

fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>

Change the background color to blue
§

fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>

Change the foreground color to magenta
§

fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>

Change the background color to magenta
§

fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>

Change the foreground color to purple
§

fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>

Change the background color to purple
§

fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>

Change the foreground color to cyan
§

fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>

Change the background color to cyan
§

fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>

Change the foreground color to white
§

fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>

Change the background color to white
§

fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>

Change the foreground color to the terminal default
§

fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>

Change the background color to the terminal default
§

fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>

Change the foreground color to bright black
§

fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>

Change the background color to bright black
§

fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>

Change the foreground color to bright red
§

fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>

Change the background color to bright red
§

fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>

Change the foreground color to bright green
§

fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>

Change the background color to bright green
§

fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>

Change the foreground color to bright yellow
§

fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>

Change the background color to bright yellow
§

fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>

Change the foreground color to bright blue
§

fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>

Change the background color to bright blue
§

fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright magenta
§

fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

Change the background color to bright magenta
§

fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright purple
§

fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

Change the background color to bright purple
§

fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>

Change the foreground color to bright cyan
§

fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>

Change the background color to bright cyan
§

fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>

Change the foreground color to bright white
§

fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>

Change the background color to bright white
§

fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>

Make the text bold
§

fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>

Make the text dim
§

fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>

Make the text italicized
§

fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>

Make the text italicized
Make the text blink
Make the text blink (but fast!)
§

fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>

Swap the foreground and background colors
§

fn hidden<'a>(&'a self) -> HiddenDisplay<'a, Self>

Hide the text
§

fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>

Cross out the text
§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
§

impl<D> OwoColorize for D

§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either [OwoColorize::fg] or a color-specific method, such as [OwoColorize::green], Read more
§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either [OwoColorize::bg] or a color-specific method, such as [OwoColorize::on_yellow], Read more
§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
source§

impl<Response, Error> ResponseResult<Response, Error> for Response

source§

fn into_result(self) -> Result<Response, Error>

Converts the type into a Result that can be sent as a response.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more