Skip to main content

NextestConfig

Struct NextestConfig 

Source
pub struct NextestConfig { /* private fields */ }
Expand description

Overall configuration for nextest.

This is the root data structure for nextest configuration. Most runner-specific configuration is managed through profiles, obtained through the profile method.

For more about configuration, see Configuration in the nextest book.

Implementations§

Source§

impl NextestConfig

Source

pub const CONFIG_PATH: &'static str = ".config/nextest.toml"

The default location of the config within the path: .config/nextest.toml, used to read the config from the given directory.

Source

pub const DEFAULT_CONFIG: &'static str = "# This is the default config used by nextest. It is embedded in the binary at\n# build time. It may be used as a template for .config/nextest.toml.\n\n[store]\n# The directory under the workspace root at which nextest-related files are\n# written. Profile-specific storage is currently written to dir/<profile-name>.\ndir = \"target/nextest\"\n\n# This section defines the default nextest profile. Custom profiles are layered\n# on top of the default profile.\n[profile.default]\n# The set of tests run by `cargo nextest run` by default.\ndefault-filter = \"all()\"\n\n# Retry policy for failed tests. A non-zero value causes tests that pass on a\n# subsequent attempt to be marked as flaky. Can be overridden through the\n# `--retries` option.\n# Examples:\n# * retries = 3\n# * retries = { backoff = \"fixed\", count = 2, delay = \"1s\" }\n# * retries = { backoff = \"exponential\", count = 10, delay = \"1s\", jitter = true, max-delay = \"10s\" }\nretries = 0\n\n# Whether to treat flaky tests as passing or failing.\nflaky-result = \"pass\"\n\n# Number of threads to run tests with. Either an integer or \"num-cpus\". Can be\n# overridden through the `--test-threads` option.\ntest-threads = \"num-cpus\"\n\n# Number of threads (slots) each test reserves from the pool. Generally used in\n# overrides to mark certain tests as heavier than others; can also be set as a\n# global default.\nthreads-required = 1\n\n# Extra arguments to pass to test binaries at runtime. Intended primarily for\n# communication with custom test harnesses -- use with caution!\nrun-extra-args = []\n\n# Level of status information to display during test runs.\n#\n# Status levels are incremental: each level includes all levels above it. For\n# example, \"slow\" implies \"retry\" and \"fail\".\n#\n# Valid values:\n# * \"none\": no output.\n# * \"fail\": only output test failures.\n# * \"retry\": output test retries; includes \"fail\".\n# * \"slow\": output slow tests; includes \"retry\".\n# * \"leak\": output leaky tests; includes \"slow\".\n# * \"pass\": output passing tests; includes \"leak\".\n# * \"skip\": output skipped tests; includes \"pass\".\n# * \"all\": equivalent to \"skip\" today; reserved for future expansion.\n#\n# Can be overridden through the `--status-level` flag.\nstatus-level = \"pass\"\n\n# Level of status information to display in the final summary. Differs from\n# status-level in that it has a separate \"flaky\" indicator distinct from\n# \"retry\" (though \"retry\" works as an alias), and in that \"skip\" is prioritized\n# over \"pass\".\nfinal-status-level = \"flaky\"\n\n# When to display output for failed tests.\n#\n# Valid values:\n# * \"immediate\": show captured output as soon as the test completes.\n# * \"final\": show captured output only at the end of the run.\n# * \"immediate-final\": show captured output when the test completes and again\n# at the end of the run.\n# * \"never\": never show captured output.\n#\n# For large test suites and CI it is generally useful to use \"immediate-final\".\n#\n# Can be overridden through the `--failure-output` option.\nfailure-output = \"immediate\"\n\n# When to display output for successful tests. Generally best left as \"never\".\nsuccess-output = \"never\"\n\n# Failure handling for the test run. Accepted values:\n# * true: stop running tests after the first failure (waits for running tests\n# to complete).\n# * false: run all tests regardless of failures.\n# * { max-fail = 10 }: stop after 10 failures (waits for running tests).\n# * { max-fail = 10, terminate = \"wait\" }: same as above (explicit).\n# * { max-fail = 10, terminate = \"immediate\" }: stop and terminate running\n# tests immediately.\n# * { max-fail = \"all\" }: run all tests regardless of failures.\n#\n# For CI runs, consider setting this to false.\nfail-fast = true\n\n# Treat a test that takes longer than the configured \'period\' as slow, and print a message.\n# See <https://nexte.st/docs/features/slow-tests> for more information.\n#\n# Optional: specify the parameter \'terminate-after\' with a non-zero integer,\n# which will cause slow tests to be terminated after the specified number of\n# periods have passed.\n# Example: slow-timeout = { period = \"60s\", terminate-after = 2 }\n#\n# The \'on-timeout\' parameter controls whether timeouts are treated as failures (the default)\n# or successes.\n# Example: slow-timeout = { period = \"60s\", on-timeout = \"pass\" }\nslow-timeout = { period = \"60s\", on-timeout = \"fail\" }\n\n# Time after which benchmarks are considered slow, plus optional termination\n# policy. Replaces `slow-timeout` when running `cargo nextest bench`.\n# See <https://nexte.st/docs/features/slow-tests> for more information.\n#\n# Optional: specify the parameter \'terminate-after\' with a non-zero integer,\n# which will cause slow benchmarks to be terminated after the specified number of\n# periods have passed.\n# Example: bench.slow-timeout = { period = \"60s\", terminate-after = 2 }\n#\n# Benchmarks have a separate configuration because they are often expected to\n# take longer than tests. Defaults to 30 years, which is a large enough value\n# to feel \"infinite\" without running into overflows on various platforms.\nbench.slow-timeout = { period = \"30y\" }\n\n# Global timeout for the entire benchmark run. Replaces `global-timeout` when\n# running `cargo nextest bench`.\n#\n# Benchmarks have a separate configuration because they are often expected to\n# take longer than tests. Defaults to 30 years, which is a large enough value\n# to feel \"infinite\" without running into overflows on various platforms.\nbench.global-timeout = \"30y\"\n\n# Treat a test as leaky if after the process is shut down, standard output and standard error\n# aren\'t closed within this duration.\n#\n# This usually happens in case of a test that creates a child process and lets it inherit those\n# handles, but doesn\'t clean the child process up (especially when it fails).\n#\n# See <https://nexte.st/docs/features/leaky-tests> for more information.\nleak-timeout = \"200ms\"\n\n# Stop all tests after the configured global timeout.\n#\n# Defaults to 30 years, which is a large enough value to feel \"infinite\" without\n# running into overflows on various platforms.\nglobal-timeout = \"30y\"\n\n# Extra paths to include in `nextest archive`. The standard build output is\n# included automatically; use this to add any non-standard files the tests\n# need at runtime.\narchive.include = [\n # Examples:\n #\n # { path = \"application-data\", relative-to = \"target\" },\n # { path = \"data-from-some-dependency/file.txt\", relative-to = \"target\" },\n #\n # In the above example:\n # * the directory and its contents at \"target/application-data\" are\n # included recursively in the archive.\n # * the file \"target/data-from-some-dependency/file.txt\" is included in\n # the archive.\n]\n\n[profile.default.junit]\n# Path to write the JUnit XML report to, relative to \'store.dir/<profile-name>\'.\n# If unset, JUnit reporting is disabled.\n\n# path = \"junit.xml\"\n\n# Name for the JUnit XML report. When aggregating reports across different test\n# runs, it may be useful to provide separate names for each report.\nreport-name = \"nextest-run\"\n\n# Whether to store successful test output in the JUnit XML report. When true,\n# output is stored in the <system-out> and <system-err> elements of the\n# <testcase> element.\nstore-success-output = false\n\n# Whether to store failed test output in the JUnit XML report. When true,\n# output is stored in the <system-out> and <system-err> elements of the\n# <testcase> element.\n#\n# Note that if a description can be extracted from the output, it is always\n# stored in the <description> element.\nstore-failure-output = true\n\n# How flaky-fail tests are reported in the JUnit XML report. \"failure\" reports\n# them as failures with <failure> and <flakyFailure> elements; \"success\"\n# reports them as successes, identical to flaky-pass tests.\nflaky-fail-status = \"failure\"\n\n# This profile is activated if MIRI_SYSROOT is set.\n[profile.default-miri]\n"

Contains the default config as a TOML file.

Repository-specific configuration is layered on top of the default config.

Source

pub const SCHEMA: &'static str = "{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"title\": \"NextestConfigDeserialize\",\n \"type\": \"object\",\n \"properties\": {\n \"experimental\": {\n \"description\": \"Enables experimental, non-stable features.\",\n \"$ref\": \"#/$defs/ExperimentalDeserialize\"\n },\n \"nextest-version\": {\n \"description\": \"The minimum required (and optionally recommended) version of nextest\\nfor this configuration.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/NextestVersionDeserialize\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"profile\": {\n \"description\": \"Test profiles, keyed by profile name.\",\n \"type\": [\n \"object\",\n \"null\"\n ],\n \"additionalProperties\": {\n \"$ref\": \"#/$defs/CustomProfileImpl\"\n }\n },\n \"script\": {\n \"description\": \"Deprecated location for setup scripts.\\n\\nNew configurations should use `[scripts.setup.<name>]` instead.\",\n \"type\": \"object\",\n \"additionalProperties\": {\n \"$ref\": \"#/$defs/SetupScriptConfig\"\n }\n },\n \"scripts\": {\n \"description\": \"Setup and wrapper scripts, keyed by script name.\",\n \"$ref\": \"#/$defs/ScriptConfig\"\n },\n \"store\": {\n \"description\": \"Configuration for the nextest store directory.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/StoreConfigImpl\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"test-groups\": {\n \"description\": \"Custom test groups for mutual exclusion and resource management, keyed\\nby group name.\",\n \"type\": \"object\",\n \"additionalProperties\": {\n \"$ref\": \"#/$defs/TestGroupConfig\"\n }\n }\n },\n \"additionalProperties\": false,\n \"x-tombi-toml-version\": \"v1.1.0\",\n \"$defs\": {\n \"ArchiveConfig\": {\n \"description\": \"Archive configuration for this profile.\",\n \"type\": \"object\",\n \"properties\": {\n \"include\": {\n \"description\": \"Extra paths to include in the archive.\",\n \"type\": [\n \"array\",\n \"null\"\n ],\n \"items\": {\n \"$ref\": \"#/$defs/ArchiveInclude\"\n }\n }\n },\n \"additionalProperties\": false\n },\n \"ArchiveInclude\": {\n \"description\": \"A single entry under `archive.include`.\",\n \"type\": \"object\",\n \"properties\": {\n \"depth\": {\n \"description\": \"Maximum recursion depth: a non-negative integer, or `\\\"infinite\\\"`.\",\n \"oneOf\": [\n {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n {\n \"type\": \"string\",\n \"enum\": [\n \"infinite\"\n ]\n }\n ]\n },\n \"on-missing\": {\n \"description\": \"What to do if `path` is missing: `\\\"ignore\\\"`, `\\\"warn\\\"`, or `\\\"error\\\"`.\",\n \"$ref\": \"#/$defs/ArchiveIncludeOnMissing\"\n },\n \"path\": {\n \"description\": \"Path to include, relative to `relative-to`.\",\n \"type\": \"string\"\n },\n \"relative-to\": {\n \"description\": \"Base directory `path` is interpreted relative to.\",\n \"$ref\": \"#/$defs/ArchiveRelativeTo\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"path\",\n \"relative-to\"\n ]\n },\n \"ArchiveIncludeOnMissing\": {\n \"description\": \"What to do when an `archive.include` path is missing.\",\n \"oneOf\": [\n {\n \"description\": \"Skip the missing path (printed in verbose mode).\",\n \"type\": \"string\",\n \"const\": \"ignore\"\n },\n {\n \"description\": \"Print a warning and continue.\",\n \"type\": \"string\",\n \"const\": \"warn\"\n },\n {\n \"description\": \"Produce an error and abort the archive operation.\",\n \"type\": \"string\",\n \"const\": \"error\"\n }\n ]\n },\n \"ArchiveRelativeTo\": {\n \"description\": \"Base directory `path` is interpreted relative to.\",\n \"oneOf\": [\n {\n \"description\": \"Resolve `path` against the target directory.\",\n \"type\": \"string\",\n \"const\": \"target\"\n }\n ]\n },\n \"BenchConfig\": {\n \"description\": \"Benchmark-specific timeout overrides used when running\\n`cargo nextest bench`.\\n\\nEach field, if set, replaces its non-`bench` counterpart for benchmark\\nruns only.\",\n \"type\": \"object\",\n \"properties\": {\n \"global-timeout\": {\n \"description\": \"Global timeout for the entire benchmark run. Replaces `global-timeout`\\nwhen running `cargo nextest bench`.\",\n \"type\": [\n \"string\",\n \"null\"\n ]\n },\n \"slow-timeout\": {\n \"description\": \"Time after which benchmarks are considered slow, plus optional\\ntermination policy. Replaces `slow-timeout` when running\\n`cargo nextest bench`.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/SlowTimeout\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n },\n \"additionalProperties\": false\n },\n \"ConfigIdentifier\": {\n \"description\": \"An identifier used in configuration.\\n\\nThe identifier goes through some basic validation:\\n* conversion to NFC\\n* ensuring that it is of the form (XID_Start)(XID_Continue | -)*\\n\\nIdentifiers can also be tool identifiers, which are of the form \\\"@tool:tool-name:identifier\\\".\",\n \"type\": \"string\"\n },\n \"CustomProfileImpl\": {\n \"type\": \"object\",\n \"properties\": {\n \"archive\": {\n \"description\": \"Archive configuration for this profile.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/ArchiveConfig\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"bench\": {\n \"description\": \"Benchmark-specific configuration.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/BenchConfig\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"default-filter\": {\n \"description\": \"The default set of tests run by `cargo nextest run`, as a filterset\\nexpression.\",\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"default\": null\n },\n \"fail-fast\": {\n \"description\": \"Controls when to stop running tests after failures.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/MaxFail\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"failure-output\": {\n \"description\": \"When to display output for failed tests.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/TestOutputDisplay\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"default\": null\n },\n \"final-status-level\": {\n \"description\": \"Level of status information to display in the final summary.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/FinalStatusLevel\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"flaky-result\": {\n \"description\": \"Whether to treat flaky tests as passing or failing.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/FlakyResult\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"default\": null\n },\n \"global-timeout\": {\n \"description\": \"A global timeout for the entire test run.\",\n \"type\": [\n \"string\",\n \"null\"\n ]\n },\n \"inherits\": {\n \"description\": \"The profile to inherit settings from.\",\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"default\": null\n },\n \"junit\": {\n \"description\": \"JUnit XML output configuration.\",\n \"$ref\": \"#/$defs/JunitImpl\"\n },\n \"leak-timeout\": {\n \"description\": \"Time to wait for child processes to exit after a test completes.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/LeakTimeout\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"overrides\": {\n \"description\": \"Per-test setting overrides, evaluated in order.\",\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DeserializedOverride\"\n }\n },\n \"retries\": {\n \"description\": \"Retry policy for failed tests.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/RetryPolicy\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"run-extra-args\": {\n \"description\": \"Extra arguments to pass to test binaries.\",\n \"type\": [\n \"array\",\n \"null\"\n ],\n \"default\": null,\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"scripts\": {\n \"description\": \"Profile-specific script bindings (setup and wrapper).\",\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DeserializedProfileScriptConfig\"\n }\n },\n \"slow-timeout\": {\n \"description\": \"Time after which tests are considered slow, plus optional termination\\npolicy.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/SlowTimeout\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"status-level\": {\n \"description\": \"Level of status information to display during test runs.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/StatusLevel\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"success-output\": {\n \"description\": \"When to display output for successful tests.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/TestOutputDisplay\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"default\": null\n },\n \"test-threads\": {\n \"description\": \"Number of threads to run tests with.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/TestThreads\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"threads-required\": {\n \"description\": \"Number of threads (slots) each test reserves from the pool.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/ThreadsRequired\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n },\n \"additionalProperties\": false\n },\n \"CustomTestGroup\": {\n \"description\": \"Represents a custom test group.\",\n \"$ref\": \"#/$defs/ConfigIdentifier\"\n },\n \"DeserializedJunitOutput\": {\n \"type\": \"object\",\n \"properties\": {\n \"flaky-fail-status\": {\n \"description\": \"How flaky-fail tests are reported in the JUnit XML report.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/JunitFlakyFailStatus\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"store-failure-output\": {\n \"description\": \"Whether to store failed output for matching tests in the JUnit XML\\nreport.\",\n \"type\": [\n \"boolean\",\n \"null\"\n ]\n },\n \"store-success-output\": {\n \"description\": \"Whether to store successful output for matching tests in the JUnit XML\\nreport.\",\n \"type\": [\n \"boolean\",\n \"null\"\n ]\n }\n },\n \"additionalProperties\": false\n },\n \"DeserializedOverride\": {\n \"description\": \"Deserialized form of profile overrides before compilation.\",\n \"type\": \"object\",\n \"properties\": {\n \"bench\": {\n \"description\": \"Benchmark-specific overrides for matching tests.\",\n \"$ref\": \"#/$defs/DeserializedOverrideBench\"\n },\n \"default-filter\": {\n \"description\": \"Replaces `default-filter` for matching platforms. Requires `platform`\\nand must not be combined with `filter`.\",\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"default\": null\n },\n \"failure-output\": {\n \"description\": \"When to display output for matching failed tests.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/TestOutputDisplay\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"default\": null\n },\n \"filter\": {\n \"description\": \"Filterset expression selecting tests this override applies to.\",\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"default\": null\n },\n \"flaky-result\": {\n \"description\": \"Whether to treat matching flaky tests as passing or failing.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/FlakyResult\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"default\": null\n },\n \"junit\": {\n \"description\": \"JUnit XML output settings for matching tests.\",\n \"$ref\": \"#/$defs/DeserializedJunitOutput\"\n },\n \"leak-timeout\": {\n \"description\": \"Leak timeout for matching tests.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/LeakTimeout\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"platform\": {\n \"description\": \"Host and/or target platforms this override applies to.\",\n \"$ref\": \"#/$defs/PlatformStrings\"\n },\n \"priority\": {\n \"description\": \"Priority for matching tests; higher values run sooner.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/TestPriority\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"retries\": {\n \"description\": \"Retry policy for matching tests.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/RetryPolicy\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"run-extra-args\": {\n \"description\": \"Extra arguments to pass to matching test binaries.\",\n \"type\": [\n \"array\",\n \"null\"\n ],\n \"default\": null,\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"slow-timeout\": {\n \"description\": \"Slow timeout for matching tests.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/SlowTimeout\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"success-output\": {\n \"description\": \"When to display output for matching successful tests.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/TestOutputDisplay\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"default\": null\n },\n \"test-group\": {\n \"description\": \"Test group to put matching tests in.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/CustomTestGroup\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"default\": null\n },\n \"threads-required\": {\n \"description\": \"Number of threads each matching test reserves from the pool.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/ThreadsRequired\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n },\n \"additionalProperties\": false\n },\n \"DeserializedOverrideBench\": {\n \"description\": \"Deserialized form of benchmark-specific overrides.\",\n \"type\": \"object\",\n \"properties\": {\n \"slow-timeout\": {\n \"description\": \"Slow timeout for matching benchmarks.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/SlowTimeout\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n },\n \"additionalProperties\": false\n },\n \"DeserializedProfileScriptConfig\": {\n \"description\": \"Deserialized form of profile-specific script configuration before compilation.\",\n \"type\": \"object\",\n \"properties\": {\n \"filter\": {\n \"description\": \"Filterset expression selecting tests these scripts apply to.\",\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"default\": null\n },\n \"list-wrapper\": {\n \"description\": \"Name of the wrapper script used during test listing.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/ScriptId\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"default\": null\n },\n \"platform\": {\n \"description\": \"Host and/or target platforms these scripts apply to.\",\n \"$ref\": \"#/$defs/PlatformStrings\"\n },\n \"run-wrapper\": {\n \"description\": \"Name of the wrapper script used during test execution.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/ScriptId\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"default\": null\n },\n \"setup\": {\n \"description\": \"Names of setup scripts to run (single name or array).\",\n \"default\": [],\n \"oneOf\": [\n {\n \"$ref\": \"#/$defs/ScriptId\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/ScriptId\"\n }\n }\n ]\n }\n },\n \"additionalProperties\": false\n },\n \"ExperimentalDeserialize\": {\n \"oneOf\": [\n {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"enum\": [\n \"setup-scripts\",\n \"wrapper-scripts\",\n \"benchmarks\"\n ]\n }\n },\n {\n \"type\": \"object\",\n \"properties\": {\n \"benchmarks\": {\n \"type\": \"boolean\"\n },\n \"setup-scripts\": {\n \"type\": \"boolean\"\n },\n \"wrapper-scripts\": {\n \"type\": \"boolean\"\n }\n },\n \"additionalProperties\": true\n }\n ]\n },\n \"FinalStatusLevel\": {\n \"description\": \"Level of status information to display in the final summary.\\n\\nStatus levels are incremental. This differs from `status-level` in two\\nways:\\n\\n* It has a \\\"flaky\\\" test indicator distinct from \\\"retry\\\" (though \\\"retry\\\"\\n works as an alias).\\n* It has a different ordering: skipped tests are prioritized over passing\\n ones.\",\n \"oneOf\": [\n {\n \"description\": \"No output.\",\n \"type\": \"string\",\n \"const\": \"none\"\n },\n {\n \"description\": \"Only output test failures.\",\n \"type\": \"string\",\n \"const\": \"fail\"\n },\n {\n \"description\": \"Output flaky tests; includes `fail`. Accepts `\\\"retry\\\"` as an alias.\",\n \"type\": \"string\",\n \"const\": \"flaky\"\n },\n {\n \"description\": \"Output slow tests; includes `flaky`.\",\n \"type\": \"string\",\n \"const\": \"slow\"\n },\n {\n \"description\": \"Output skipped tests; includes `slow`.\",\n \"type\": \"string\",\n \"const\": \"skip\"\n },\n {\n \"description\": \"Output leaky tests; includes `skip`.\",\n \"type\": \"string\",\n \"const\": \"leak\"\n },\n {\n \"description\": \"Output passing tests; includes `leak`.\",\n \"type\": \"string\",\n \"const\": \"pass\"\n },\n {\n \"description\": \"Equivalent to `\\\"pass\\\"` today; reserved for future expansion.\",\n \"type\": \"string\",\n \"const\": \"all\"\n }\n ]\n },\n \"FlakyResult\": {\n \"description\": \"Controls whether a flaky test is treated as a pass or a failure.\",\n \"oneOf\": [\n {\n \"description\": \"The test is marked as failed.\",\n \"type\": \"string\",\n \"const\": \"fail\"\n },\n {\n \"description\": \"The test is marked as passed.\",\n \"type\": \"string\",\n \"const\": \"pass\"\n }\n ]\n },\n \"JunitFlakyFailStatus\": {\n \"description\": \"Controls how flaky-fail tests are reported in JUnit XML output.\\n\\nFlaky-fail tests are tests that eventually passed on retry but are configured\\nwith `flaky-result = \\\"fail\\\"`. This setting controls whether they appear as\\nfailures or successes in the JUnit report.\",\n \"oneOf\": [\n {\n \"description\": \"Report flaky-fail tests as failures with `<failure>` and\\n`<flakyFailure>` elements.\",\n \"type\": \"string\",\n \"const\": \"failure\"\n },\n {\n \"description\": \"Report flaky-fail tests as successes, identical to flaky-pass tests.\",\n \"type\": \"string\",\n \"const\": \"success\"\n }\n ]\n },\n \"JunitImpl\": {\n \"type\": \"object\",\n \"properties\": {\n \"flaky-fail-status\": {\n \"description\": \"How flaky-fail tests are reported in the JUnit XML report.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/JunitFlakyFailStatus\"\n },\n {\n \"type\": \"null\"\n }\n ],\n \"default\": null\n },\n \"path\": {\n \"description\": \"Path to write the JUnit XML report to. If unset, JUnit reporting is\\ndisabled.\",\n \"type\": \"string\",\n \"default\": null\n },\n \"report-name\": {\n \"description\": \"Name for the JUnit XML report.\",\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"default\": null\n },\n \"store-failure-output\": {\n \"description\": \"Whether to store failed test output in the JUnit XML report.\",\n \"type\": [\n \"boolean\",\n \"null\"\n ],\n \"default\": null\n },\n \"store-success-output\": {\n \"description\": \"Whether to store successful test output in the JUnit XML report.\",\n \"type\": [\n \"boolean\",\n \"null\"\n ],\n \"default\": null\n }\n },\n \"additionalProperties\": false\n },\n \"LeakTimeout\": {\n \"title\": \"LeakTimeout\",\n \"oneOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"object\",\n \"properties\": {\n \"period\": {\n \"type\": \"string\"\n },\n \"result\": {\n \"$ref\": \"#/$defs/LeakTimeoutResult\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"period\"\n ]\n }\n ]\n },\n \"LeakTimeoutResult\": {\n \"description\": \"Whether to mark a test as passed or failed when the leak timeout elapses.\",\n \"oneOf\": [\n {\n \"description\": \"Mark the test as failed.\",\n \"type\": \"string\",\n \"const\": \"fail\"\n },\n {\n \"description\": \"Mark the test as passed.\",\n \"type\": \"string\",\n \"const\": \"pass\"\n }\n ]\n },\n \"MaxFail\": {\n \"oneOf\": [\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"object\",\n \"properties\": {\n \"max-fail\": {\n \"oneOf\": [\n {\n \"type\": \"integer\",\n \"minimum\": 1\n },\n {\n \"type\": \"string\",\n \"enum\": [\n \"all\"\n ]\n }\n ]\n },\n \"terminate\": {\n \"$ref\": \"#/$defs/TerminateMode\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"max-fail\"\n ]\n }\n ]\n },\n \"NextestVersionDeserialize\": {\n \"oneOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"object\",\n \"properties\": {\n \"recommended\": {\n \"type\": \"string\"\n },\n \"required\": {\n \"type\": \"string\"\n }\n },\n \"additionalProperties\": false\n }\n ]\n },\n \"PlatformStrings\": {\n \"oneOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"object\",\n \"properties\": {\n \"host\": {\n \"type\": [\n \"string\",\n \"null\"\n ]\n },\n \"target\": {\n \"type\": [\n \"string\",\n \"null\"\n ]\n }\n },\n \"additionalProperties\": false\n }\n ]\n },\n \"RetryPolicy\": {\n \"title\": \"RetryPolicy\",\n \"oneOf\": [\n {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n {\n \"type\": \"object\",\n \"properties\": {\n \"backoff\": {\n \"type\": \"string\",\n \"const\": \"fixed\"\n },\n \"count\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"delay\": {\n \"type\": \"string\"\n },\n \"jitter\": {\n \"type\": \"boolean\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"backoff\",\n \"count\"\n ]\n },\n {\n \"type\": \"object\",\n \"properties\": {\n \"backoff\": {\n \"type\": \"string\",\n \"const\": \"exponential\"\n },\n \"count\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"delay\": {\n \"type\": \"string\"\n },\n \"jitter\": {\n \"type\": \"boolean\"\n },\n \"max-delay\": {\n \"type\": \"string\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"backoff\",\n \"count\",\n \"delay\"\n ]\n }\n ]\n },\n \"ScriptCommand\": {\n \"title\": \"ScriptCommand\",\n \"oneOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"minItems\": 1\n },\n {\n \"type\": \"object\",\n \"properties\": {\n \"command-line\": {\n \"oneOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"minItems\": 1\n }\n ]\n },\n \"env\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"type\": \"string\"\n }\n },\n \"relative-to\": {\n \"$ref\": \"#/$defs/ScriptCommandRelativeTo\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"command-line\"\n ]\n }\n ]\n },\n \"ScriptCommandRelativeTo\": {\n \"description\": \"Base directory a relative script program is resolved against.\\n\\nIf specified, the program is joined with the provided path.\",\n \"oneOf\": [\n {\n \"description\": \"Use the program path as-is, without joining.\",\n \"type\": \"string\",\n \"const\": \"none\"\n },\n {\n \"description\": \"Resolve the program against the workspace root.\",\n \"type\": \"string\",\n \"const\": \"workspace-root\"\n },\n {\n \"description\": \"Resolve the program against the target directory.\",\n \"type\": \"string\",\n \"const\": \"target\"\n }\n ]\n },\n \"ScriptConfig\": {\n \"description\": \"Setup and wrapper scripts defined in nextest configuration.\",\n \"type\": \"object\",\n \"properties\": {\n \"setup\": {\n \"description\": \"Setup scripts, keyed by script name.\",\n \"type\": \"object\",\n \"additionalProperties\": {\n \"$ref\": \"#/$defs/SetupScriptConfig\"\n }\n },\n \"wrapper\": {\n \"description\": \"Wrapper scripts, keyed by script name.\",\n \"type\": \"object\",\n \"additionalProperties\": {\n \"$ref\": \"#/$defs/WrapperScriptConfig\"\n }\n }\n },\n \"additionalProperties\": false\n },\n \"ScriptId\": {\n \"description\": \"The name of a configuration script.\",\n \"type\": \"string\"\n },\n \"SetupScriptConfig\": {\n \"description\": \"Deserialized form of setup script configuration before compilation.\\n\\nThis is defined as a top-level element.\",\n \"type\": \"object\",\n \"properties\": {\n \"capture-stderr\": {\n \"description\": \"Whether to capture stderr from this setup script.\",\n \"type\": \"boolean\",\n \"default\": false\n },\n \"capture-stdout\": {\n \"description\": \"Whether to capture stdout from this setup script.\",\n \"type\": \"boolean\",\n \"default\": false\n },\n \"command\": {\n \"description\": \"The command to run for this setup script.\",\n \"$ref\": \"#/$defs/ScriptCommand\"\n },\n \"junit\": {\n \"description\": \"JUnit XML output settings for this setup script.\",\n \"$ref\": \"#/$defs/SetupScriptJunitConfig\"\n },\n \"leak-timeout\": {\n \"description\": \"Leak-timeout configuration for this setup script.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/LeakTimeout\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"slow-timeout\": {\n \"description\": \"Slow-timeout configuration for this setup script.\",\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/SlowTimeout\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"command\"\n ]\n },\n \"SetupScriptJunitConfig\": {\n \"description\": \"JUnit XML output settings for a setup script.\",\n \"type\": \"object\",\n \"properties\": {\n \"store-failure-output\": {\n \"description\": \"Whether to store this setup script\'s output on failure in the JUnit XML\\nreport. Defaults to true.\",\n \"type\": \"boolean\",\n \"default\": true\n },\n \"store-success-output\": {\n \"description\": \"Whether to store this setup script\'s output on success in the JUnit XML\\nreport. Defaults to true.\",\n \"type\": \"boolean\",\n \"default\": true\n }\n },\n \"additionalProperties\": false\n },\n \"SlowTimeout\": {\n \"title\": \"SlowTimeout\",\n \"oneOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"object\",\n \"properties\": {\n \"grace-period\": {\n \"type\": \"string\"\n },\n \"on-timeout\": {\n \"$ref\": \"#/$defs/SlowTimeoutResult\"\n },\n \"period\": {\n \"type\": \"string\"\n },\n \"terminate-after\": {\n \"type\": [\n \"integer\",\n \"null\"\n ],\n \"minimum\": 1\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"period\"\n ]\n }\n ]\n },\n \"SlowTimeoutResult\": {\n \"description\": \"The result of controlling slow timeout behavior.\\n\\nIn most situations a timed out test should be marked failing. However, there are certain\\nclasses of tests which are expected to run indefinitely long, like fuzzing, which explores a\\nhuge state space. For these tests it\'s nice to be able to treat a timeout as a success since\\nthey generally check for invariants and other properties of the code under test during their\\nexecution. A timeout in this context doesn\'t mean that there are no failing inputs, it just\\nmeans that they weren\'t found up until that moment, which is still valuable information.\",\n \"oneOf\": [\n {\n \"description\": \"The test is marked as failed.\",\n \"type\": \"string\",\n \"const\": \"fail\"\n },\n {\n \"description\": \"The test is marked as passed.\",\n \"type\": \"string\",\n \"const\": \"pass\"\n }\n ]\n },\n \"StatusLevel\": {\n \"description\": \"Level of status information to display during test runs.\\n\\nStatus levels are incremental: each level causes all the statuses listed\\nabove it to be output. For example, `slow` implies `retry` and `fail`.\",\n \"oneOf\": [\n {\n \"description\": \"No output.\",\n \"type\": \"string\",\n \"const\": \"none\"\n },\n {\n \"description\": \"Only output test failures.\",\n \"type\": \"string\",\n \"const\": \"fail\"\n },\n {\n \"description\": \"Output test retries; includes `fail`.\",\n \"type\": \"string\",\n \"const\": \"retry\"\n },\n {\n \"description\": \"Output slow tests; includes `retry`.\",\n \"type\": \"string\",\n \"const\": \"slow\"\n },\n {\n \"description\": \"Output leaky tests; includes `slow`.\",\n \"type\": \"string\",\n \"const\": \"leak\"\n },\n {\n \"description\": \"Output passing tests; includes `leak`.\",\n \"type\": \"string\",\n \"const\": \"pass\"\n },\n {\n \"description\": \"Output skipped tests; includes `pass`.\",\n \"type\": \"string\",\n \"const\": \"skip\"\n },\n {\n \"description\": \"Equivalent to `\\\"skip\\\"` today; reserved for future expansion.\",\n \"type\": \"string\",\n \"const\": \"all\"\n }\n ]\n },\n \"StoreConfigImpl\": {\n \"type\": \"object\",\n \"properties\": {\n \"dir\": {\n \"description\": \"Directory where nextest stores its data.\",\n \"type\": [\n \"string\",\n \"null\"\n ]\n }\n },\n \"additionalProperties\": false\n },\n \"TerminateMode\": {\n \"description\": \"Mode for terminating running tests when max-fail is exceeded.\",\n \"oneOf\": [\n {\n \"description\": \"Wait for running tests to complete naturally.\",\n \"type\": \"string\",\n \"const\": \"wait\"\n },\n {\n \"description\": \"Send termination signals to running tests immediately.\",\n \"type\": \"string\",\n \"const\": \"immediate\"\n }\n ]\n },\n \"TestGroupConfig\": {\n \"description\": \"Configuration for a single test group.\",\n \"type\": \"object\",\n \"properties\": {\n \"max-threads\": {\n \"description\": \"Maximum number of threads this test group may use concurrently.\",\n \"$ref\": \"#/$defs/TestThreads\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"max-threads\"\n ]\n },\n \"TestOutputDisplay\": {\n \"description\": \"When to display test output in the reporter.\",\n \"oneOf\": [\n {\n \"description\": \"Shows captured output as soon as the test completes.\",\n \"type\": \"string\",\n \"const\": \"immediate\"\n },\n {\n \"description\": \"Shows captured output when the test completes and again at the end of\\nthe run.\",\n \"type\": \"string\",\n \"const\": \"immediate-final\"\n },\n {\n \"description\": \"Shows captured output only at the end of the run.\",\n \"type\": \"string\",\n \"const\": \"final\"\n },\n {\n \"description\": \"Never shows captured output.\",\n \"type\": \"string\",\n \"const\": \"never\"\n }\n ]\n },\n \"TestPriority\": {\n \"description\": \"A test priority between -100 and 100, inclusive. Higher values run sooner.\",\n \"type\": \"integer\",\n \"format\": \"int8\",\n \"maximum\": 100,\n \"minimum\": -100\n },\n \"TestThreads\": {\n \"oneOf\": [\n {\n \"type\": \"integer\",\n \"not\": {\n \"const\": 0\n }\n },\n {\n \"type\": \"string\",\n \"enum\": [\n \"num-cpus\"\n ]\n }\n ]\n },\n \"ThreadsRequired\": {\n \"oneOf\": [\n {\n \"type\": \"integer\",\n \"minimum\": 1\n },\n {\n \"type\": \"string\",\n \"enum\": [\n \"num-cpus\",\n \"num-test-threads\"\n ]\n }\n ]\n },\n \"WrapperScriptConfig\": {\n \"description\": \"Deserialized form of wrapper script configuration before compilation.\\n\\nThis is defined as a top-level element.\",\n \"type\": \"object\",\n \"properties\": {\n \"command\": {\n \"description\": \"The command to run as the wrapper.\",\n \"$ref\": \"#/$defs/ScriptCommand\"\n },\n \"target-runner\": {\n \"description\": \"How this wrapper composes with a configured target runner.\",\n \"$ref\": \"#/$defs/WrapperScriptTargetRunner\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\n \"command\"\n ]\n },\n \"WrapperScriptTargetRunner\": {\n \"description\": \"How a wrapper script composes with a configured target runner.\",\n \"oneOf\": [\n {\n \"description\": \"The target runner is ignored.\",\n \"type\": \"string\",\n \"const\": \"ignore\"\n },\n {\n \"description\": \"When a target runner is configured, it replaces the wrapper; otherwise\\nthe wrapper runs as usual.\",\n \"type\": \"string\",\n \"const\": \"overrides-wrapper\"\n },\n {\n \"description\": \"The target runner runs within the wrapper script. The command line used\\nis `<wrapper> <target-runner> <test-binary> <args>`.\",\n \"type\": \"string\",\n \"const\": \"within-wrapper\"\n },\n {\n \"description\": \"The target runner runs around the wrapper script. The command line used\\nis `<target-runner> <wrapper> <test-binary> <args>`.\",\n \"type\": \"string\",\n \"const\": \"around-wrapper\"\n }\n ]\n }\n }\n}\n"

The pregenerated JSON Schema for .config/nextest.toml.

The schema is checked into the repository at nextest-runner/jsonschemas/repo-config.json. (If you’re working within the nextest repository, regenerate the schema with just generate-schemas.)

Source

pub const ENVIRONMENT_PREFIX: &'static str = "NEXTEST"

Environment configuration uses this prefix, plus a _.

Source

pub const DEFAULT_PROFILE: &'static str = "default"

The name of the default profile.

Source

pub const DEFAULT_MIRI_PROFILE: &'static str = "default-miri"

The name of the default profile used for miri.

Source

pub const DEFAULT_PROFILES: &'static [&'static str]

A list containing the names of the Nextest defined reserved profile names.

Source

pub fn from_sources<'a, I>( workspace_root: impl Into<Utf8PathBuf>, pcx: &ParseContext<'_>, config_file: Option<&Utf8Path>, tool_config_files: impl IntoIterator<IntoIter = I>, experimental: &BTreeSet<ConfigExperimental>, ) -> Result<Self, ConfigParseError>

Reads the nextest config from the given file, or if not specified from .config/nextest.toml in the workspace root.

tool_config_files are lower priority than config_file but higher priority than the default config. Files in tool_config_files that come earlier are higher priority than those that come later.

If no config files are specified and this file doesn’t have .config/nextest.toml, uses the default config options.

Source

pub fn from_sources_with_warnings<'a, I>( workspace_root: impl Into<Utf8PathBuf>, pcx: &ParseContext<'_>, config_file: Option<&Utf8Path>, tool_config_files: impl IntoIterator<IntoIter = I>, experimental: &BTreeSet<ConfigExperimental>, warnings: &mut impl ConfigWarnings, ) -> Result<Self, ConfigParseError>

Load configuration from the given sources with custom warning handling.

Source

pub fn profile( &self, name: impl AsRef<str>, ) -> Result<EarlyProfile<'_>, ProfileNotFound>

Returns the profile with the given name, or an error if a profile was specified but not found.

Trait Implementations§

Source§

impl Clone for NextestConfig

Source§

fn clone(&self) -> NextestConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NextestConfig

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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
Source§

impl<D> OwoColorize for D

Source§

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

Set the foreground color generically Read more
Source§

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

Set the background color generically. Read more
Source§

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

Change the foreground color to black
Source§

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

Change the background color to black
Source§

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

Change the foreground color to red
Source§

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

Change the background color to red
Source§

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

Change the foreground color to green
Source§

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

Change the background color to green
Source§

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

Change the foreground color to yellow
Source§

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

Change the background color to yellow
Source§

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

Change the foreground color to blue
Source§

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

Change the background color to blue
Source§

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

Change the foreground color to magenta
Source§

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

Change the background color to magenta
Source§

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

Change the foreground color to purple
Source§

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

Change the background color to purple
Source§

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

Change the foreground color to cyan
Source§

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

Change the background color to cyan
Source§

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

Change the foreground color to white
Source§

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

Change the background color to white
Source§

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

Change the foreground color to the terminal default
Source§

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

Change the background color to the terminal default
Source§

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

Change the foreground color to bright black
Source§

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

Change the background color to bright black
Source§

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

Change the foreground color to bright red
Source§

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

Change the background color to bright red
Source§

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

Change the foreground color to bright green
Source§

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

Change the background color to bright green
Source§

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

Change the foreground color to bright yellow
Source§

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

Change the background color to bright yellow
Source§

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

Change the foreground color to bright blue
Source§

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

Change the background color to bright blue
Source§

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

Change the foreground color to bright magenta
Source§

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

Change the background color to bright magenta
Source§

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

Change the foreground color to bright purple
Source§

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

Change the background color to bright purple
Source§

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

Change the foreground color to bright cyan
Source§

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

Change the background color to bright cyan
Source§

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

Change the foreground color to bright white
Source§

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

Change the background color to bright white
Source§

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

Make the text bold
Source§

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

Make the text dim
Source§

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

Make the text italicized
Source§

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

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

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

Swap the foreground and background colors
Source§

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

Hide the text
Source§

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

Cross out the text
Source§

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
Source§

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
Source§

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.
Source§

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.
Source§

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

Sets the foreground color to an RGB value.
Source§

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

Sets the background color to an RGB value.
Source§

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

Apply a runtime-determined style
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
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