#[non_exhaustive]pub enum Error {
Show 16 variants
CustomHealthNotFound(CustomHealthNotFound),
DuplicateRequest(DuplicateRequest),
InstanceNotFound(InstanceNotFound),
InvalidInput(InvalidInput),
NamespaceAlreadyExists(NamespaceAlreadyExists),
NamespaceNotFound(NamespaceNotFound),
OperationNotFound(OperationNotFound),
RequestLimitExceeded(RequestLimitExceeded),
ResourceInUse(ResourceInUse),
ResourceLimitExceeded(ResourceLimitExceeded),
ResourceNotFoundException(ResourceNotFoundException),
ServiceAlreadyExists(ServiceAlreadyExists),
ServiceAttributesLimitExceededException(ServiceAttributesLimitExceededException),
ServiceNotFound(ServiceNotFound),
TooManyTagsException(TooManyTagsException),
Unhandled(Unhandled),
}Expand description
All possible error types for this service.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
CustomHealthNotFound(CustomHealthNotFound)
The health check for the instance that's specified by ServiceId and InstanceId isn't a custom health check.
DuplicateRequest(DuplicateRequest)
The operation is already in progress.
InstanceNotFound(InstanceNotFound)
No instance exists with the specified ID, or the instance was recently registered, and information about the instance hasn't propagated yet.
InvalidInput(InvalidInput)
One or more specified values aren't valid. For example, a required value might be missing, a numeric value might be outside the allowed range, or a string value might exceed length constraints.
NamespaceAlreadyExists(NamespaceAlreadyExists)
The namespace that you're trying to create already exists.
NamespaceNotFound(NamespaceNotFound)
No namespace exists with the specified ID.
OperationNotFound(OperationNotFound)
No operation exists with the specified ID.
RequestLimitExceeded(RequestLimitExceeded)
The operation can't be completed because you've reached the quota for the number of requests. For more information, see Cloud Map API request throttling quota in the Cloud Map Developer Guide.
ResourceInUse(ResourceInUse)
The specified resource can't be deleted because it contains other resources. For example, you can't delete a service that contains any instances.
ResourceLimitExceeded(ResourceLimitExceeded)
The resource can't be created because you've reached the quota on the number of resources.
ResourceNotFoundException(ResourceNotFoundException)
The operation can't be completed because the resource was not found.
ServiceAlreadyExists(ServiceAlreadyExists)
The service can't be created because a service with the same name already exists.
ServiceAttributesLimitExceededException(ServiceAttributesLimitExceededException)
The attribute can't be added to the service because you've exceeded the quota for the number of attributes you can add to a service.
ServiceNotFound(ServiceNotFound)
No service exists with the specified ID.
TooManyTagsException(TooManyTagsException)
The list of tags on the resource is over the quota. The maximum number of tags that can be applied to a resource is 50.
Unhandled(Unhandled)
Unhandled directly is not forwards compatible. Instead, match using a variable wildcard pattern and check .code():
err if err.code() == Some("SpecificExceptionCode") => { /* handle the error */ }
See ProvideErrorMetadata for what information is available for the error.An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
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
Source§impl From<BuildError> for Error
impl From<BuildError> for Error
Source§fn from(value: BuildError) -> Self
fn from(value: BuildError) -> Self
Source§impl From<CreateHttpNamespaceError> for Error
impl From<CreateHttpNamespaceError> for Error
Source§fn from(err: CreateHttpNamespaceError) -> Self
fn from(err: CreateHttpNamespaceError) -> Self
Source§impl From<CreatePrivateDnsNamespaceError> for Error
impl From<CreatePrivateDnsNamespaceError> for Error
Source§fn from(err: CreatePrivateDnsNamespaceError) -> Self
fn from(err: CreatePrivateDnsNamespaceError) -> Self
Source§impl From<CreatePublicDnsNamespaceError> for Error
impl From<CreatePublicDnsNamespaceError> for Error
Source§fn from(err: CreatePublicDnsNamespaceError) -> Self
fn from(err: CreatePublicDnsNamespaceError) -> Self
Source§impl From<CreateServiceError> for Error
impl From<CreateServiceError> for Error
Source§fn from(err: CreateServiceError) -> Self
fn from(err: CreateServiceError) -> Self
Source§impl From<DeleteNamespaceError> for Error
impl From<DeleteNamespaceError> for Error
Source§fn from(err: DeleteNamespaceError) -> Self
fn from(err: DeleteNamespaceError) -> Self
Source§impl From<DeleteServiceAttributesError> for Error
impl From<DeleteServiceAttributesError> for Error
Source§fn from(err: DeleteServiceAttributesError) -> Self
fn from(err: DeleteServiceAttributesError) -> Self
Source§impl From<DeleteServiceError> for Error
impl From<DeleteServiceError> for Error
Source§fn from(err: DeleteServiceError) -> Self
fn from(err: DeleteServiceError) -> Self
Source§impl From<DeregisterInstanceError> for Error
impl From<DeregisterInstanceError> for Error
Source§fn from(err: DeregisterInstanceError) -> Self
fn from(err: DeregisterInstanceError) -> Self
Source§impl From<DiscoverInstancesError> for Error
impl From<DiscoverInstancesError> for Error
Source§fn from(err: DiscoverInstancesError) -> Self
fn from(err: DiscoverInstancesError) -> Self
Source§impl From<DiscoverInstancesRevisionError> for Error
impl From<DiscoverInstancesRevisionError> for Error
Source§fn from(err: DiscoverInstancesRevisionError) -> Self
fn from(err: DiscoverInstancesRevisionError) -> Self
Source§impl From<GetInstanceError> for Error
impl From<GetInstanceError> for Error
Source§fn from(err: GetInstanceError) -> Self
fn from(err: GetInstanceError) -> Self
Source§impl From<GetInstancesHealthStatusError> for Error
impl From<GetInstancesHealthStatusError> for Error
Source§fn from(err: GetInstancesHealthStatusError) -> Self
fn from(err: GetInstancesHealthStatusError) -> Self
Source§impl From<GetNamespaceError> for Error
impl From<GetNamespaceError> for Error
Source§fn from(err: GetNamespaceError) -> Self
fn from(err: GetNamespaceError) -> Self
Source§impl From<GetOperationError> for Error
impl From<GetOperationError> for Error
Source§fn from(err: GetOperationError) -> Self
fn from(err: GetOperationError) -> Self
Source§impl From<GetServiceAttributesError> for Error
impl From<GetServiceAttributesError> for Error
Source§fn from(err: GetServiceAttributesError) -> Self
fn from(err: GetServiceAttributesError) -> Self
Source§impl From<GetServiceError> for Error
impl From<GetServiceError> for Error
Source§fn from(err: GetServiceError) -> Self
fn from(err: GetServiceError) -> Self
Source§impl From<ListInstancesError> for Error
impl From<ListInstancesError> for Error
Source§fn from(err: ListInstancesError) -> Self
fn from(err: ListInstancesError) -> Self
Source§impl From<ListNamespacesError> for Error
impl From<ListNamespacesError> for Error
Source§fn from(err: ListNamespacesError) -> Self
fn from(err: ListNamespacesError) -> Self
Source§impl From<ListOperationsError> for Error
impl From<ListOperationsError> for Error
Source§fn from(err: ListOperationsError) -> Self
fn from(err: ListOperationsError) -> Self
Source§impl From<ListServicesError> for Error
impl From<ListServicesError> for Error
Source§fn from(err: ListServicesError) -> Self
fn from(err: ListServicesError) -> Self
Source§impl From<ListTagsForResourceError> for Error
impl From<ListTagsForResourceError> for Error
Source§fn from(err: ListTagsForResourceError) -> Self
fn from(err: ListTagsForResourceError) -> Self
Source§impl From<RegisterInstanceError> for Error
impl From<RegisterInstanceError> for Error
Source§fn from(err: RegisterInstanceError) -> Self
fn from(err: RegisterInstanceError) -> Self
Source§impl<R> From<SdkError<CreateHttpNamespaceError, R>> for Error
impl<R> From<SdkError<CreateHttpNamespaceError, R>> for Error
Source§fn from(err: SdkError<CreateHttpNamespaceError, R>) -> Self
fn from(err: SdkError<CreateHttpNamespaceError, R>) -> Self
Source§impl<R> From<SdkError<CreatePrivateDnsNamespaceError, R>> for Error
impl<R> From<SdkError<CreatePrivateDnsNamespaceError, R>> for Error
Source§fn from(err: SdkError<CreatePrivateDnsNamespaceError, R>) -> Self
fn from(err: SdkError<CreatePrivateDnsNamespaceError, R>) -> Self
Source§impl<R> From<SdkError<CreatePublicDnsNamespaceError, R>> for Error
impl<R> From<SdkError<CreatePublicDnsNamespaceError, R>> for Error
Source§fn from(err: SdkError<CreatePublicDnsNamespaceError, R>) -> Self
fn from(err: SdkError<CreatePublicDnsNamespaceError, R>) -> Self
Source§impl<R> From<SdkError<CreateServiceError, R>> for Error
impl<R> From<SdkError<CreateServiceError, R>> for Error
Source§fn from(err: SdkError<CreateServiceError, R>) -> Self
fn from(err: SdkError<CreateServiceError, R>) -> Self
Source§impl<R> From<SdkError<DeleteNamespaceError, R>> for Error
impl<R> From<SdkError<DeleteNamespaceError, R>> for Error
Source§fn from(err: SdkError<DeleteNamespaceError, R>) -> Self
fn from(err: SdkError<DeleteNamespaceError, R>) -> Self
Source§impl<R> From<SdkError<DeleteServiceAttributesError, R>> for Error
impl<R> From<SdkError<DeleteServiceAttributesError, R>> for Error
Source§fn from(err: SdkError<DeleteServiceAttributesError, R>) -> Self
fn from(err: SdkError<DeleteServiceAttributesError, R>) -> Self
Source§impl<R> From<SdkError<DeleteServiceError, R>> for Error
impl<R> From<SdkError<DeleteServiceError, R>> for Error
Source§fn from(err: SdkError<DeleteServiceError, R>) -> Self
fn from(err: SdkError<DeleteServiceError, R>) -> Self
Source§impl<R> From<SdkError<DeregisterInstanceError, R>> for Error
impl<R> From<SdkError<DeregisterInstanceError, R>> for Error
Source§fn from(err: SdkError<DeregisterInstanceError, R>) -> Self
fn from(err: SdkError<DeregisterInstanceError, R>) -> Self
Source§impl<R> From<SdkError<DiscoverInstancesError, R>> for Error
impl<R> From<SdkError<DiscoverInstancesError, R>> for Error
Source§fn from(err: SdkError<DiscoverInstancesError, R>) -> Self
fn from(err: SdkError<DiscoverInstancesError, R>) -> Self
Source§impl<R> From<SdkError<DiscoverInstancesRevisionError, R>> for Error
impl<R> From<SdkError<DiscoverInstancesRevisionError, R>> for Error
Source§fn from(err: SdkError<DiscoverInstancesRevisionError, R>) -> Self
fn from(err: SdkError<DiscoverInstancesRevisionError, R>) -> Self
Source§impl<R> From<SdkError<GetInstanceError, R>> for Error
impl<R> From<SdkError<GetInstanceError, R>> for Error
Source§fn from(err: SdkError<GetInstanceError, R>) -> Self
fn from(err: SdkError<GetInstanceError, R>) -> Self
Source§impl<R> From<SdkError<GetInstancesHealthStatusError, R>> for Error
impl<R> From<SdkError<GetInstancesHealthStatusError, R>> for Error
Source§fn from(err: SdkError<GetInstancesHealthStatusError, R>) -> Self
fn from(err: SdkError<GetInstancesHealthStatusError, R>) -> Self
Source§impl<R> From<SdkError<GetNamespaceError, R>> for Error
impl<R> From<SdkError<GetNamespaceError, R>> for Error
Source§fn from(err: SdkError<GetNamespaceError, R>) -> Self
fn from(err: SdkError<GetNamespaceError, R>) -> Self
Source§impl<R> From<SdkError<GetOperationError, R>> for Error
impl<R> From<SdkError<GetOperationError, R>> for Error
Source§fn from(err: SdkError<GetOperationError, R>) -> Self
fn from(err: SdkError<GetOperationError, R>) -> Self
Source§impl<R> From<SdkError<GetServiceAttributesError, R>> for Error
impl<R> From<SdkError<GetServiceAttributesError, R>> for Error
Source§fn from(err: SdkError<GetServiceAttributesError, R>) -> Self
fn from(err: SdkError<GetServiceAttributesError, R>) -> Self
Source§impl<R> From<SdkError<GetServiceError, R>> for Error
impl<R> From<SdkError<GetServiceError, R>> for Error
Source§fn from(err: SdkError<GetServiceError, R>) -> Self
fn from(err: SdkError<GetServiceError, R>) -> Self
Source§impl<R> From<SdkError<ListInstancesError, R>> for Error
impl<R> From<SdkError<ListInstancesError, R>> for Error
Source§fn from(err: SdkError<ListInstancesError, R>) -> Self
fn from(err: SdkError<ListInstancesError, R>) -> Self
Source§impl<R> From<SdkError<ListNamespacesError, R>> for Error
impl<R> From<SdkError<ListNamespacesError, R>> for Error
Source§fn from(err: SdkError<ListNamespacesError, R>) -> Self
fn from(err: SdkError<ListNamespacesError, R>) -> Self
Source§impl<R> From<SdkError<ListOperationsError, R>> for Error
impl<R> From<SdkError<ListOperationsError, R>> for Error
Source§fn from(err: SdkError<ListOperationsError, R>) -> Self
fn from(err: SdkError<ListOperationsError, R>) -> Self
Source§impl<R> From<SdkError<ListServicesError, R>> for Error
impl<R> From<SdkError<ListServicesError, R>> for Error
Source§fn from(err: SdkError<ListServicesError, R>) -> Self
fn from(err: SdkError<ListServicesError, R>) -> Self
Source§impl<R> From<SdkError<ListTagsForResourceError, R>> for Error
impl<R> From<SdkError<ListTagsForResourceError, R>> for Error
Source§fn from(err: SdkError<ListTagsForResourceError, R>) -> Self
fn from(err: SdkError<ListTagsForResourceError, R>) -> Self
Source§impl<R> From<SdkError<RegisterInstanceError, R>> for Error
impl<R> From<SdkError<RegisterInstanceError, R>> for Error
Source§fn from(err: SdkError<RegisterInstanceError, R>) -> Self
fn from(err: SdkError<RegisterInstanceError, R>) -> Self
Source§impl<R> From<SdkError<TagResourceError, R>> for Error
impl<R> From<SdkError<TagResourceError, R>> for Error
Source§fn from(err: SdkError<TagResourceError, R>) -> Self
fn from(err: SdkError<TagResourceError, R>) -> Self
Source§impl<R> From<SdkError<UntagResourceError, R>> for Error
impl<R> From<SdkError<UntagResourceError, R>> for Error
Source§fn from(err: SdkError<UntagResourceError, R>) -> Self
fn from(err: SdkError<UntagResourceError, R>) -> Self
Source§impl<R> From<SdkError<UpdateHttpNamespaceError, R>> for Error
impl<R> From<SdkError<UpdateHttpNamespaceError, R>> for Error
Source§fn from(err: SdkError<UpdateHttpNamespaceError, R>) -> Self
fn from(err: SdkError<UpdateHttpNamespaceError, R>) -> Self
Source§impl<R> From<SdkError<UpdateInstanceCustomHealthStatusError, R>> for Error
impl<R> From<SdkError<UpdateInstanceCustomHealthStatusError, R>> for Error
Source§fn from(err: SdkError<UpdateInstanceCustomHealthStatusError, R>) -> Self
fn from(err: SdkError<UpdateInstanceCustomHealthStatusError, R>) -> Self
Source§impl<R> From<SdkError<UpdatePrivateDnsNamespaceError, R>> for Error
impl<R> From<SdkError<UpdatePrivateDnsNamespaceError, R>> for Error
Source§fn from(err: SdkError<UpdatePrivateDnsNamespaceError, R>) -> Self
fn from(err: SdkError<UpdatePrivateDnsNamespaceError, R>) -> Self
Source§impl<R> From<SdkError<UpdatePublicDnsNamespaceError, R>> for Error
impl<R> From<SdkError<UpdatePublicDnsNamespaceError, R>> for Error
Source§fn from(err: SdkError<UpdatePublicDnsNamespaceError, R>) -> Self
fn from(err: SdkError<UpdatePublicDnsNamespaceError, R>) -> Self
Source§impl<R> From<SdkError<UpdateServiceAttributesError, R>> for Error
impl<R> From<SdkError<UpdateServiceAttributesError, R>> for Error
Source§fn from(err: SdkError<UpdateServiceAttributesError, R>) -> Self
fn from(err: SdkError<UpdateServiceAttributesError, R>) -> Self
Source§impl<R> From<SdkError<UpdateServiceError, R>> for Error
impl<R> From<SdkError<UpdateServiceError, R>> for Error
Source§fn from(err: SdkError<UpdateServiceError, R>) -> Self
fn from(err: SdkError<UpdateServiceError, R>) -> Self
Source§impl From<TagResourceError> for Error
impl From<TagResourceError> for Error
Source§fn from(err: TagResourceError) -> Self
fn from(err: TagResourceError) -> Self
Source§impl From<UntagResourceError> for Error
impl From<UntagResourceError> for Error
Source§fn from(err: UntagResourceError) -> Self
fn from(err: UntagResourceError) -> Self
Source§impl From<UpdateHttpNamespaceError> for Error
impl From<UpdateHttpNamespaceError> for Error
Source§fn from(err: UpdateHttpNamespaceError) -> Self
fn from(err: UpdateHttpNamespaceError) -> Self
Source§impl From<UpdateInstanceCustomHealthStatusError> for Error
impl From<UpdateInstanceCustomHealthStatusError> for Error
Source§fn from(err: UpdateInstanceCustomHealthStatusError) -> Self
fn from(err: UpdateInstanceCustomHealthStatusError) -> Self
Source§impl From<UpdatePrivateDnsNamespaceError> for Error
impl From<UpdatePrivateDnsNamespaceError> for Error
Source§fn from(err: UpdatePrivateDnsNamespaceError) -> Self
fn from(err: UpdatePrivateDnsNamespaceError) -> Self
Source§impl From<UpdatePublicDnsNamespaceError> for Error
impl From<UpdatePublicDnsNamespaceError> for Error
Source§fn from(err: UpdatePublicDnsNamespaceError) -> Self
fn from(err: UpdatePublicDnsNamespaceError) -> Self
Source§impl From<UpdateServiceAttributesError> for Error
impl From<UpdateServiceAttributesError> for Error
Source§fn from(err: UpdateServiceAttributesError) -> Self
fn from(err: UpdateServiceAttributesError) -> Self
Source§impl From<UpdateServiceError> for Error
impl From<UpdateServiceError> for Error
Source§fn from(err: UpdateServiceError) -> Self
fn from(err: UpdateServiceError) -> Self
Source§impl ProvideErrorMetadata for Error
impl ProvideErrorMetadata for Error
Source§fn meta(&self) -> &ErrorMetadata
fn meta(&self) -> &ErrorMetadata
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<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>
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);