#[non_exhaustive]pub enum Error {
Show 72 variants
MissingCrateParameter,
MissingCrateName {
spec: String,
},
InvalidRepoFormat {
repo: String,
},
GitSelectorWithoutGitSource,
InvalidVersionReq {
version: String,
source: Error,
},
InvalidUrl {
url: String,
source: ParseError,
},
ConflictingVersions {
at_version: String,
flag_version: String,
},
CargoNotRunnable,
CrateNotFoundInRegistry {
name: String,
},
NoMatchingVersion {
name: String,
requirement: String,
},
PackageNotFoundInWorkspace {
name: String,
available: Vec<String>,
},
AmbiguousPackageName {
count: usize,
},
NoPackageBinaries {
krate: String,
},
AmbiguousBinaryTarget {
package: String,
available: Vec<String>,
},
RunnableTargetNotFound {
kind: &'static str,
package: String,
target: String,
available: Vec<String>,
},
VersionMismatch {
requirement: String,
found: Version,
},
Git {
source: Box<dyn Error + Send + Sync>,
},
Registry {
source: Error,
},
CargoMetadata {
cargo_path: PathBuf,
source_dir: PathBuf,
source: Error,
},
CargoTomlNotFound {
source_dir: PathBuf,
},
InvalidVersion {
version: String,
source: Error,
},
Io {
path: PathBuf,
source: Error,
},
RenameFile {
src: PathBuf,
dst: PathBuf,
source: Error,
},
CopyBinary {
src: PathBuf,
dst: PathBuf,
source: Error,
},
TempDirInCreation {
parent: PathBuf,
source: Error,
},
CommandExecution {
source: Error,
},
SbomBuilder {
message: String,
},
Json {
source: Error,
},
TomlSerialize {
source: Error,
},
OfflineMode {
name: String,
version: String,
},
RegistryDownload {
source: Error,
},
TarExtraction {
source: Error,
},
DownloadUrlUnavailable {
name: String,
version: String,
},
ExecutableNotFound {
name: String,
},
RustupNotFound {
toolchain: String,
},
BinaryNotFoundInOutput,
CargoBuildFailed {
exit_code: Option<i32>,
},
CopySourceTree {
src: PathBuf,
dst: PathBuf,
source: Box<dyn Error + Send + Sync + 'static>,
},
ConfigLoad {
path: PathBuf,
source: Error,
},
InvalidConfigValue {
field: String,
message: String,
},
ConfigExtract {
source: Error,
},
ExecFailed {
path: PathBuf,
source: Error,
},
SpawnFailed {
path: PathBuf,
source: Error,
},
WaitFailed {
source: Error,
},
Etcetera {
source: HomeDirError,
},
NoProvidersConfigured,
PrebuiltBinaryRequired {
name: String,
version: String,
},
PrebuiltBinaryResolutionFailed {
name: String,
version: String,
source: Box<Error>,
},
PrebuiltBinaryDisqualified {
name: String,
version: String,
reason: String,
},
ChecksumMismatch {
expected: String,
actual: String,
},
ChecksumUnparsable {
contents: String,
},
ProviderAssetPreparationFailed {
provider: BinaryProvider,
url: String,
source: Box<Error>,
},
UnsupportedArchiveFormat {
format: String,
},
GithubApiError {
source: Box<dyn Error + Send + Sync>,
},
QuickinstallApiError {
source: Box<dyn Error + Send + Sync>,
},
BinaryDownloadFailed {
url: String,
source: Error,
},
BinaryDownloadHttpError {
url: String,
status: StatusCode,
source: Error,
},
ArchiveExtractionFailed {
source: Box<dyn Error + Send + Sync>,
},
CargoTomlParse {
path: PathBuf,
source: Error,
},
BinstallMetadataInvalidInCargoToml {
source: Error,
},
BinstallTemplateParse {
template: String,
source: ParseError,
},
BinstallTemplateRender {
template: String,
source: RenderError,
},
HttpClientBuild {
message: String,
},
HttpRequest {
url: String,
source: Error,
},
HttpDownloadToFile {
url: String,
path: PathBuf,
source: Error,
},
HttpResponseTooLarge {
url: String,
limit: usize,
},
HttpResponseRead {
url: String,
source: Error,
},
HttpResponseUtf8 {
url: String,
source: FromUtf8Error,
},
HttpStatus {
url: String,
status: u16,
},
ProviderThrottled {
url: String,
status: u16,
},
PrefetchAllFailed {
failures: Vec<String>,
},
InvalidHttpTimeout {
value: String,
source: DurationError,
},
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MissingCrateParameter
MissingCrateName
InvalidRepoFormat
GitSelectorWithoutGitSource
InvalidVersionReq
InvalidUrl
ConflictingVersions
CargoNotRunnable
CrateNotFoundInRegistry
NoMatchingVersion
PackageNotFoundInWorkspace
AmbiguousPackageName
NoPackageBinaries
AmbiguousBinaryTarget
RunnableTargetNotFound
VersionMismatch
Git
Registry
CargoMetadata
CargoTomlNotFound
InvalidVersion
Io
RenameFile
CopyBinary
TempDirInCreation
CommandExecution
SbomBuilder
Json
TomlSerialize
OfflineMode
RegistryDownload
TarExtraction
ExecutableNotFound
RustupNotFound
BinaryNotFoundInOutput
CargoBuildFailed
CopySourceTree
ConfigLoad
InvalidConfigValue
ConfigExtract
ExecFailed
SpawnFailed
WaitFailed
Etcetera
Fields
source: HomeDirErrorNoProvidersConfigured
PrebuiltBinaryRequired
PrebuiltBinaryResolutionFailed
PrebuiltBinaryDisqualified
ChecksumMismatch
ChecksumUnparsable
ProviderAssetPreparationFailed
UnsupportedArchiveFormat
GithubApiError
QuickinstallApiError
BinaryDownloadFailed
BinaryDownloadHttpError
ArchiveExtractionFailed
CargoTomlParse
BinstallMetadataInvalidInCargoToml
BinstallTemplateParse
BinstallTemplateRender
HttpClientBuild
HttpRequest
HttpDownloadToFile
HttpResponseTooLarge
HttpResponseRead
HttpResponseUtf8
HttpStatus
ProviderThrottled
PrefetchAllFailed
InvalidHttpTimeout
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl ErrorCompat for Error
impl ErrorCompat for Error
Source§fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
Error::source. Read moreSource§impl IntoError<Error> for MissingCrateParameterSnafu
impl IntoError<Error> for MissingCrateParameterSnafu
Source§impl<__T0> IntoError<Error> for MissingCrateNameSnafu<__T0>
impl<__T0> IntoError<Error> for MissingCrateNameSnafu<__T0>
Source§impl<__T0> IntoError<Error> for InvalidRepoFormatSnafu<__T0>
impl<__T0> IntoError<Error> for InvalidRepoFormatSnafu<__T0>
Source§impl<__T0> IntoError<Error> for InvalidVersionReqSnafu<__T0>
impl<__T0> IntoError<Error> for InvalidVersionReqSnafu<__T0>
Source§impl<__T0> IntoError<Error> for InvalidUrlSnafu<__T0>
impl<__T0> IntoError<Error> for InvalidUrlSnafu<__T0>
Source§type Source = ParseError
type Source = ParseError
Source§fn into_error(self, error: Self::Source) -> Error
fn into_error(self, error: Self::Source) -> Error
Source§impl<__T0, __T1> IntoError<Error> for ConflictingVersionsSnafu<__T0, __T1>
impl<__T0, __T1> IntoError<Error> for ConflictingVersionsSnafu<__T0, __T1>
Source§impl IntoError<Error> for CargoNotRunnableSnafu
impl IntoError<Error> for CargoNotRunnableSnafu
Source§impl<__T0> IntoError<Error> for CrateNotFoundInRegistrySnafu<__T0>
impl<__T0> IntoError<Error> for CrateNotFoundInRegistrySnafu<__T0>
Source§impl<__T0, __T1> IntoError<Error> for NoMatchingVersionSnafu<__T0, __T1>
impl<__T0, __T1> IntoError<Error> for NoMatchingVersionSnafu<__T0, __T1>
Source§impl<__T0, __T1> IntoError<Error> for PackageNotFoundInWorkspaceSnafu<__T0, __T1>
impl<__T0, __T1> IntoError<Error> for PackageNotFoundInWorkspaceSnafu<__T0, __T1>
Source§impl<__T0> IntoError<Error> for AmbiguousPackageNameSnafu<__T0>
impl<__T0> IntoError<Error> for AmbiguousPackageNameSnafu<__T0>
Source§impl<__T0> IntoError<Error> for NoPackageBinariesSnafu<__T0>
impl<__T0> IntoError<Error> for NoPackageBinariesSnafu<__T0>
Source§impl<__T0, __T1> IntoError<Error> for AmbiguousBinaryTargetSnafu<__T0, __T1>
impl<__T0, __T1> IntoError<Error> for AmbiguousBinaryTargetSnafu<__T0, __T1>
Source§impl<__T0, __T1, __T2, __T3> IntoError<Error> for RunnableTargetNotFoundSnafu<__T0, __T1, __T2, __T3>
impl<__T0, __T1, __T2, __T3> IntoError<Error> for RunnableTargetNotFoundSnafu<__T0, __T1, __T2, __T3>
Source§impl<__T0, __T1> IntoError<Error> for VersionMismatchSnafu<__T0, __T1>
impl<__T0, __T1> IntoError<Error> for VersionMismatchSnafu<__T0, __T1>
Source§impl IntoError<Error> for RegistrySnafu
impl IntoError<Error> for RegistrySnafu
Source§impl<__T0, __T1> IntoError<Error> for CargoMetadataSnafu<__T0, __T1>
impl<__T0, __T1> IntoError<Error> for CargoMetadataSnafu<__T0, __T1>
Source§impl<__T0> IntoError<Error> for CargoTomlNotFoundSnafu<__T0>
impl<__T0> IntoError<Error> for CargoTomlNotFoundSnafu<__T0>
Source§impl<__T0> IntoError<Error> for InvalidVersionSnafu<__T0>
impl<__T0> IntoError<Error> for InvalidVersionSnafu<__T0>
Source§impl<__T0, __T1> IntoError<Error> for RenameFileSnafu<__T0, __T1>
impl<__T0, __T1> IntoError<Error> for RenameFileSnafu<__T0, __T1>
Source§impl<__T0, __T1> IntoError<Error> for CopyBinarySnafu<__T0, __T1>
impl<__T0, __T1> IntoError<Error> for CopyBinarySnafu<__T0, __T1>
Source§impl<__T0> IntoError<Error> for TempDirInCreationSnafu<__T0>
impl<__T0> IntoError<Error> for TempDirInCreationSnafu<__T0>
Source§impl IntoError<Error> for CommandExecutionSnafu
impl IntoError<Error> for CommandExecutionSnafu
Source§impl<__T0> IntoError<Error> for SbomBuilderSnafu<__T0>
impl<__T0> IntoError<Error> for SbomBuilderSnafu<__T0>
Source§impl IntoError<Error> for TomlSerializeSnafu
impl IntoError<Error> for TomlSerializeSnafu
Source§impl<__T0, __T1> IntoError<Error> for OfflineModeSnafu<__T0, __T1>
impl<__T0, __T1> IntoError<Error> for OfflineModeSnafu<__T0, __T1>
Source§impl IntoError<Error> for RegistryDownloadSnafu
impl IntoError<Error> for RegistryDownloadSnafu
Source§impl IntoError<Error> for TarExtractionSnafu
impl IntoError<Error> for TarExtractionSnafu
Source§impl<__T0> IntoError<Error> for ExecutableNotFoundSnafu<__T0>
impl<__T0> IntoError<Error> for ExecutableNotFoundSnafu<__T0>
Source§impl<__T0> IntoError<Error> for RustupNotFoundSnafu<__T0>
impl<__T0> IntoError<Error> for RustupNotFoundSnafu<__T0>
Source§impl IntoError<Error> for BinaryNotFoundInOutputSnafu
impl IntoError<Error> for BinaryNotFoundInOutputSnafu
Source§impl<__T0> IntoError<Error> for CargoBuildFailedSnafu<__T0>
impl<__T0> IntoError<Error> for CargoBuildFailedSnafu<__T0>
Source§impl<__T0, __T1> IntoError<Error> for CopySourceTreeSnafu<__T0, __T1>
impl<__T0, __T1> IntoError<Error> for CopySourceTreeSnafu<__T0, __T1>
Source§impl<__T0> IntoError<Error> for ConfigLoadSnafu<__T0>
impl<__T0> IntoError<Error> for ConfigLoadSnafu<__T0>
Source§impl<__T0, __T1> IntoError<Error> for InvalidConfigValueSnafu<__T0, __T1>
impl<__T0, __T1> IntoError<Error> for InvalidConfigValueSnafu<__T0, __T1>
Source§impl IntoError<Error> for ConfigExtractSnafu
impl IntoError<Error> for ConfigExtractSnafu
Source§impl<__T0> IntoError<Error> for ExecFailedSnafu<__T0>
impl<__T0> IntoError<Error> for ExecFailedSnafu<__T0>
Source§impl<__T0> IntoError<Error> for SpawnFailedSnafu<__T0>
impl<__T0> IntoError<Error> for SpawnFailedSnafu<__T0>
Source§impl IntoError<Error> for WaitFailedSnafu
impl IntoError<Error> for WaitFailedSnafu
Source§impl IntoError<Error> for EtceteraSnafu
impl IntoError<Error> for EtceteraSnafu
Source§type Source = HomeDirError
type Source = HomeDirError
Source§fn into_error(self, error: Self::Source) -> Error
fn into_error(self, error: Self::Source) -> Error
Source§impl IntoError<Error> for NoProvidersConfiguredSnafu
impl IntoError<Error> for NoProvidersConfiguredSnafu
Source§impl<__T0, __T1> IntoError<Error> for PrebuiltBinaryRequiredSnafu<__T0, __T1>
impl<__T0, __T1> IntoError<Error> for PrebuiltBinaryRequiredSnafu<__T0, __T1>
Source§impl<__T0, __T1> IntoError<Error> for PrebuiltBinaryResolutionFailedSnafu<__T0, __T1>
impl<__T0, __T1> IntoError<Error> for PrebuiltBinaryResolutionFailedSnafu<__T0, __T1>
Source§impl<__T0, __T1, __T2> IntoError<Error> for PrebuiltBinaryDisqualifiedSnafu<__T0, __T1, __T2>
impl<__T0, __T1, __T2> IntoError<Error> for PrebuiltBinaryDisqualifiedSnafu<__T0, __T1, __T2>
Source§impl<__T0, __T1> IntoError<Error> for ChecksumMismatchSnafu<__T0, __T1>
impl<__T0, __T1> IntoError<Error> for ChecksumMismatchSnafu<__T0, __T1>
Source§impl<__T0> IntoError<Error> for ChecksumUnparsableSnafu<__T0>
impl<__T0> IntoError<Error> for ChecksumUnparsableSnafu<__T0>
Source§impl<__T0, __T1> IntoError<Error> for ProviderAssetPreparationFailedSnafu<__T0, __T1>
impl<__T0, __T1> IntoError<Error> for ProviderAssetPreparationFailedSnafu<__T0, __T1>
Source§impl<__T0> IntoError<Error> for UnsupportedArchiveFormatSnafu<__T0>
impl<__T0> IntoError<Error> for UnsupportedArchiveFormatSnafu<__T0>
Source§impl IntoError<Error> for GithubApiSnafu
impl IntoError<Error> for GithubApiSnafu
Source§impl IntoError<Error> for QuickinstallApiSnafu
impl IntoError<Error> for QuickinstallApiSnafu
Source§impl<__T0> IntoError<Error> for BinaryDownloadFailedSnafu<__T0>
impl<__T0> IntoError<Error> for BinaryDownloadFailedSnafu<__T0>
Source§impl<__T0, __T1> IntoError<Error> for BinaryDownloadHttpSnafu<__T0, __T1>
impl<__T0, __T1> IntoError<Error> for BinaryDownloadHttpSnafu<__T0, __T1>
Source§impl<__T0> IntoError<Error> for CargoTomlParseSnafu<__T0>
impl<__T0> IntoError<Error> for CargoTomlParseSnafu<__T0>
Source§impl<__T0> IntoError<Error> for BinstallTemplateParseSnafu<__T0>
impl<__T0> IntoError<Error> for BinstallTemplateParseSnafu<__T0>
Source§type Source = ParseError
type Source = ParseError
Source§fn into_error(self, error: Self::Source) -> Error
fn into_error(self, error: Self::Source) -> Error
Source§impl<__T0> IntoError<Error> for BinstallTemplateRenderSnafu<__T0>
impl<__T0> IntoError<Error> for BinstallTemplateRenderSnafu<__T0>
Source§type Source = RenderError
type Source = RenderError
Source§fn into_error(self, error: Self::Source) -> Error
fn into_error(self, error: Self::Source) -> Error
Source§impl<__T0> IntoError<Error> for HttpClientBuildSnafu<__T0>
impl<__T0> IntoError<Error> for HttpClientBuildSnafu<__T0>
Source§impl<__T0> IntoError<Error> for HttpRequestSnafu<__T0>
impl<__T0> IntoError<Error> for HttpRequestSnafu<__T0>
Source§impl<__T0, __T1> IntoError<Error> for HttpDownloadToFileSnafu<__T0, __T1>
impl<__T0, __T1> IntoError<Error> for HttpDownloadToFileSnafu<__T0, __T1>
Source§impl<__T0, __T1> IntoError<Error> for HttpResponseTooLargeSnafu<__T0, __T1>
impl<__T0, __T1> IntoError<Error> for HttpResponseTooLargeSnafu<__T0, __T1>
Source§impl<__T0> IntoError<Error> for HttpResponseReadSnafu<__T0>
impl<__T0> IntoError<Error> for HttpResponseReadSnafu<__T0>
Source§impl<__T0> IntoError<Error> for HttpResponseUtf8Snafu<__T0>
impl<__T0> IntoError<Error> for HttpResponseUtf8Snafu<__T0>
Source§type Source = FromUtf8Error
type Source = FromUtf8Error
Source§fn into_error(self, error: Self::Source) -> Error
fn into_error(self, error: Self::Source) -> Error
Source§impl<__T0, __T1> IntoError<Error> for HttpStatusSnafu<__T0, __T1>
impl<__T0, __T1> IntoError<Error> for HttpStatusSnafu<__T0, __T1>
Source§impl<__T0, __T1> IntoError<Error> for ProviderThrottledSnafu<__T0, __T1>
impl<__T0, __T1> IntoError<Error> for ProviderThrottledSnafu<__T0, __T1>
Source§impl<__T0> IntoError<Error> for PrefetchAllFailedSnafu<__T0>
impl<__T0> IntoError<Error> for PrefetchAllFailedSnafu<__T0>
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
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<T> ErrorExt for T
impl<T> ErrorExt for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.