#[non_exhaustive]pub enum Error {
AccessDeniedException(AccessDeniedException),
ConflictException(ConflictException),
InternalServerException(InternalServerException),
ResourceNotFoundException(ResourceNotFoundException),
ServiceQuotaExceededException(ServiceQuotaExceededException),
ThrottlingException(ThrottlingException),
ValidationException(ValidationException),
Unhandled(Unhandled),
}
Expand description
All possible error types for this service.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AccessDeniedException(AccessDeniedException)
You don't have sufficient access to perform this action.
ConflictException(ConflictException)
The request failed because another request to modify a resource occurred at the same.
InternalServerException(InternalServerException)
The request failed because of an internal error. Try your request again later
ResourceNotFoundException(ResourceNotFoundException)
The request failed because it references a resource that doesn't exist.
ServiceQuotaExceededException(ServiceQuotaExceededException)
The request failed because it would cause a service quota to be exceeded.
ThrottlingException(ThrottlingException)
The request failed because it exceeded a throttling quota.
ValidationException(ValidationException)
The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid.
The possible reasons include the following:
-
UnrecognizedEntityType
The policy includes an entity type that isn't found in the schema.
-
UnrecognizedActionId
The policy includes an action id that isn't found in the schema.
-
InvalidActionApplication
The policy includes an action that, according to the schema, doesn't support the specified principal and resource.
-
UnexpectedType
The policy included an operand that isn't a valid type for the specified operation.
-
IncompatibleTypes
The types of elements included in a
set
, or the types of expressions used in anif...then...else
clause aren't compatible in this context. -
MissingAttribute
The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide.
-
UnsafeOptionalAttributeAccess
The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide.
-
ImpossiblePolicy
Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision.
-
WrongNumberArguments
The policy references an extension type with the wrong number of arguments.
-
FunctionArgumentValidationError
Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character.
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<BatchGetPolicyError> for Error
impl From<BatchGetPolicyError> for Error
Source§fn from(err: BatchGetPolicyError) -> Self
fn from(err: BatchGetPolicyError) -> Self
Source§impl From<BatchIsAuthorizedError> for Error
impl From<BatchIsAuthorizedError> for Error
Source§fn from(err: BatchIsAuthorizedError) -> Self
fn from(err: BatchIsAuthorizedError) -> Self
Source§impl From<BatchIsAuthorizedWithTokenError> for Error
impl From<BatchIsAuthorizedWithTokenError> for Error
Source§fn from(err: BatchIsAuthorizedWithTokenError) -> Self
fn from(err: BatchIsAuthorizedWithTokenError) -> Self
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<CreateIdentitySourceError> for Error
impl From<CreateIdentitySourceError> for Error
Source§fn from(err: CreateIdentitySourceError) -> Self
fn from(err: CreateIdentitySourceError) -> Self
Source§impl From<CreatePolicyError> for Error
impl From<CreatePolicyError> for Error
Source§fn from(err: CreatePolicyError) -> Self
fn from(err: CreatePolicyError) -> Self
Source§impl From<CreatePolicyStoreError> for Error
impl From<CreatePolicyStoreError> for Error
Source§fn from(err: CreatePolicyStoreError) -> Self
fn from(err: CreatePolicyStoreError) -> Self
Source§impl From<CreatePolicyTemplateError> for Error
impl From<CreatePolicyTemplateError> for Error
Source§fn from(err: CreatePolicyTemplateError) -> Self
fn from(err: CreatePolicyTemplateError) -> Self
Source§impl From<DeleteIdentitySourceError> for Error
impl From<DeleteIdentitySourceError> for Error
Source§fn from(err: DeleteIdentitySourceError) -> Self
fn from(err: DeleteIdentitySourceError) -> Self
Source§impl From<DeletePolicyError> for Error
impl From<DeletePolicyError> for Error
Source§fn from(err: DeletePolicyError) -> Self
fn from(err: DeletePolicyError) -> Self
Source§impl From<DeletePolicyStoreError> for Error
impl From<DeletePolicyStoreError> for Error
Source§fn from(err: DeletePolicyStoreError) -> Self
fn from(err: DeletePolicyStoreError) -> Self
Source§impl From<DeletePolicyTemplateError> for Error
impl From<DeletePolicyTemplateError> for Error
Source§fn from(err: DeletePolicyTemplateError) -> Self
fn from(err: DeletePolicyTemplateError) -> Self
Source§impl From<GetIdentitySourceError> for Error
impl From<GetIdentitySourceError> for Error
Source§fn from(err: GetIdentitySourceError) -> Self
fn from(err: GetIdentitySourceError) -> Self
Source§impl From<GetPolicyError> for Error
impl From<GetPolicyError> for Error
Source§fn from(err: GetPolicyError) -> Self
fn from(err: GetPolicyError) -> Self
Source§impl From<GetPolicyStoreError> for Error
impl From<GetPolicyStoreError> for Error
Source§fn from(err: GetPolicyStoreError) -> Self
fn from(err: GetPolicyStoreError) -> Self
Source§impl From<GetPolicyTemplateError> for Error
impl From<GetPolicyTemplateError> for Error
Source§fn from(err: GetPolicyTemplateError) -> Self
fn from(err: GetPolicyTemplateError) -> Self
Source§impl From<GetSchemaError> for Error
impl From<GetSchemaError> for Error
Source§fn from(err: GetSchemaError) -> Self
fn from(err: GetSchemaError) -> Self
Source§impl From<IsAuthorizedError> for Error
impl From<IsAuthorizedError> for Error
Source§fn from(err: IsAuthorizedError) -> Self
fn from(err: IsAuthorizedError) -> Self
Source§impl From<IsAuthorizedWithTokenError> for Error
impl From<IsAuthorizedWithTokenError> for Error
Source§fn from(err: IsAuthorizedWithTokenError) -> Self
fn from(err: IsAuthorizedWithTokenError) -> Self
Source§impl From<ListIdentitySourcesError> for Error
impl From<ListIdentitySourcesError> for Error
Source§fn from(err: ListIdentitySourcesError) -> Self
fn from(err: ListIdentitySourcesError) -> Self
Source§impl From<ListPoliciesError> for Error
impl From<ListPoliciesError> for Error
Source§fn from(err: ListPoliciesError) -> Self
fn from(err: ListPoliciesError) -> Self
Source§impl From<ListPolicyStoresError> for Error
impl From<ListPolicyStoresError> for Error
Source§fn from(err: ListPolicyStoresError) -> Self
fn from(err: ListPolicyStoresError) -> Self
Source§impl From<ListPolicyTemplatesError> for Error
impl From<ListPolicyTemplatesError> for Error
Source§fn from(err: ListPolicyTemplatesError) -> Self
fn from(err: ListPolicyTemplatesError) -> Self
Source§impl From<PutSchemaError> for Error
impl From<PutSchemaError> for Error
Source§fn from(err: PutSchemaError) -> Self
fn from(err: PutSchemaError) -> Self
Source§impl<R> From<SdkError<BatchGetPolicyError, R>> for Error
impl<R> From<SdkError<BatchGetPolicyError, R>> for Error
Source§fn from(err: SdkError<BatchGetPolicyError, R>) -> Self
fn from(err: SdkError<BatchGetPolicyError, R>) -> Self
Source§impl<R> From<SdkError<BatchIsAuthorizedError, R>> for Error
impl<R> From<SdkError<BatchIsAuthorizedError, R>> for Error
Source§fn from(err: SdkError<BatchIsAuthorizedError, R>) -> Self
fn from(err: SdkError<BatchIsAuthorizedError, R>) -> Self
Source§impl<R> From<SdkError<BatchIsAuthorizedWithTokenError, R>> for Error
impl<R> From<SdkError<BatchIsAuthorizedWithTokenError, R>> for Error
Source§fn from(err: SdkError<BatchIsAuthorizedWithTokenError, R>) -> Self
fn from(err: SdkError<BatchIsAuthorizedWithTokenError, R>) -> Self
Source§impl<R> From<SdkError<CreateIdentitySourceError, R>> for Error
impl<R> From<SdkError<CreateIdentitySourceError, R>> for Error
Source§fn from(err: SdkError<CreateIdentitySourceError, R>) -> Self
fn from(err: SdkError<CreateIdentitySourceError, R>) -> Self
Source§impl<R> From<SdkError<CreatePolicyError, R>> for Error
impl<R> From<SdkError<CreatePolicyError, R>> for Error
Source§fn from(err: SdkError<CreatePolicyError, R>) -> Self
fn from(err: SdkError<CreatePolicyError, R>) -> Self
Source§impl<R> From<SdkError<CreatePolicyStoreError, R>> for Error
impl<R> From<SdkError<CreatePolicyStoreError, R>> for Error
Source§fn from(err: SdkError<CreatePolicyStoreError, R>) -> Self
fn from(err: SdkError<CreatePolicyStoreError, R>) -> Self
Source§impl<R> From<SdkError<CreatePolicyTemplateError, R>> for Error
impl<R> From<SdkError<CreatePolicyTemplateError, R>> for Error
Source§fn from(err: SdkError<CreatePolicyTemplateError, R>) -> Self
fn from(err: SdkError<CreatePolicyTemplateError, R>) -> Self
Source§impl<R> From<SdkError<DeleteIdentitySourceError, R>> for Error
impl<R> From<SdkError<DeleteIdentitySourceError, R>> for Error
Source§fn from(err: SdkError<DeleteIdentitySourceError, R>) -> Self
fn from(err: SdkError<DeleteIdentitySourceError, R>) -> Self
Source§impl<R> From<SdkError<DeletePolicyError, R>> for Error
impl<R> From<SdkError<DeletePolicyError, R>> for Error
Source§fn from(err: SdkError<DeletePolicyError, R>) -> Self
fn from(err: SdkError<DeletePolicyError, R>) -> Self
Source§impl<R> From<SdkError<DeletePolicyStoreError, R>> for Error
impl<R> From<SdkError<DeletePolicyStoreError, R>> for Error
Source§fn from(err: SdkError<DeletePolicyStoreError, R>) -> Self
fn from(err: SdkError<DeletePolicyStoreError, R>) -> Self
Source§impl<R> From<SdkError<DeletePolicyTemplateError, R>> for Error
impl<R> From<SdkError<DeletePolicyTemplateError, R>> for Error
Source§fn from(err: SdkError<DeletePolicyTemplateError, R>) -> Self
fn from(err: SdkError<DeletePolicyTemplateError, R>) -> Self
Source§impl<R> From<SdkError<GetIdentitySourceError, R>> for Error
impl<R> From<SdkError<GetIdentitySourceError, R>> for Error
Source§fn from(err: SdkError<GetIdentitySourceError, R>) -> Self
fn from(err: SdkError<GetIdentitySourceError, R>) -> Self
Source§impl<R> From<SdkError<GetPolicyError, R>> for Error
impl<R> From<SdkError<GetPolicyError, R>> for Error
Source§fn from(err: SdkError<GetPolicyError, R>) -> Self
fn from(err: SdkError<GetPolicyError, R>) -> Self
Source§impl<R> From<SdkError<GetPolicyStoreError, R>> for Error
impl<R> From<SdkError<GetPolicyStoreError, R>> for Error
Source§fn from(err: SdkError<GetPolicyStoreError, R>) -> Self
fn from(err: SdkError<GetPolicyStoreError, R>) -> Self
Source§impl<R> From<SdkError<GetPolicyTemplateError, R>> for Error
impl<R> From<SdkError<GetPolicyTemplateError, R>> for Error
Source§fn from(err: SdkError<GetPolicyTemplateError, R>) -> Self
fn from(err: SdkError<GetPolicyTemplateError, R>) -> Self
Source§impl<R> From<SdkError<GetSchemaError, R>> for Error
impl<R> From<SdkError<GetSchemaError, R>> for Error
Source§fn from(err: SdkError<GetSchemaError, R>) -> Self
fn from(err: SdkError<GetSchemaError, R>) -> Self
Source§impl<R> From<SdkError<IsAuthorizedError, R>> for Error
impl<R> From<SdkError<IsAuthorizedError, R>> for Error
Source§fn from(err: SdkError<IsAuthorizedError, R>) -> Self
fn from(err: SdkError<IsAuthorizedError, R>) -> Self
Source§impl<R> From<SdkError<IsAuthorizedWithTokenError, R>> for Error
impl<R> From<SdkError<IsAuthorizedWithTokenError, R>> for Error
Source§fn from(err: SdkError<IsAuthorizedWithTokenError, R>) -> Self
fn from(err: SdkError<IsAuthorizedWithTokenError, R>) -> Self
Source§impl<R> From<SdkError<ListIdentitySourcesError, R>> for Error
impl<R> From<SdkError<ListIdentitySourcesError, R>> for Error
Source§fn from(err: SdkError<ListIdentitySourcesError, R>) -> Self
fn from(err: SdkError<ListIdentitySourcesError, R>) -> Self
Source§impl<R> From<SdkError<ListPoliciesError, R>> for Error
impl<R> From<SdkError<ListPoliciesError, R>> for Error
Source§fn from(err: SdkError<ListPoliciesError, R>) -> Self
fn from(err: SdkError<ListPoliciesError, R>) -> Self
Source§impl<R> From<SdkError<ListPolicyStoresError, R>> for Error
impl<R> From<SdkError<ListPolicyStoresError, R>> for Error
Source§fn from(err: SdkError<ListPolicyStoresError, R>) -> Self
fn from(err: SdkError<ListPolicyStoresError, R>) -> Self
Source§impl<R> From<SdkError<ListPolicyTemplatesError, R>> for Error
impl<R> From<SdkError<ListPolicyTemplatesError, R>> for Error
Source§fn from(err: SdkError<ListPolicyTemplatesError, R>) -> Self
fn from(err: SdkError<ListPolicyTemplatesError, R>) -> Self
Source§impl<R> From<SdkError<PutSchemaError, R>> for Error
impl<R> From<SdkError<PutSchemaError, R>> for Error
Source§fn from(err: SdkError<PutSchemaError, R>) -> Self
fn from(err: SdkError<PutSchemaError, R>) -> Self
Source§impl<R> From<SdkError<UpdateIdentitySourceError, R>> for Error
impl<R> From<SdkError<UpdateIdentitySourceError, R>> for Error
Source§fn from(err: SdkError<UpdateIdentitySourceError, R>) -> Self
fn from(err: SdkError<UpdateIdentitySourceError, R>) -> Self
Source§impl<R> From<SdkError<UpdatePolicyError, R>> for Error
impl<R> From<SdkError<UpdatePolicyError, R>> for Error
Source§fn from(err: SdkError<UpdatePolicyError, R>) -> Self
fn from(err: SdkError<UpdatePolicyError, R>) -> Self
Source§impl<R> From<SdkError<UpdatePolicyStoreError, R>> for Error
impl<R> From<SdkError<UpdatePolicyStoreError, R>> for Error
Source§fn from(err: SdkError<UpdatePolicyStoreError, R>) -> Self
fn from(err: SdkError<UpdatePolicyStoreError, R>) -> Self
Source§impl<R> From<SdkError<UpdatePolicyTemplateError, R>> for Error
impl<R> From<SdkError<UpdatePolicyTemplateError, R>> for Error
Source§fn from(err: SdkError<UpdatePolicyTemplateError, R>) -> Self
fn from(err: SdkError<UpdatePolicyTemplateError, R>) -> Self
Source§impl From<UpdateIdentitySourceError> for Error
impl From<UpdateIdentitySourceError> for Error
Source§fn from(err: UpdateIdentitySourceError) -> Self
fn from(err: UpdateIdentitySourceError) -> Self
Source§impl From<UpdatePolicyError> for Error
impl From<UpdatePolicyError> for Error
Source§fn from(err: UpdatePolicyError) -> Self
fn from(err: UpdatePolicyError) -> Self
Source§impl From<UpdatePolicyStoreError> for Error
impl From<UpdatePolicyStoreError> for Error
Source§fn from(err: UpdatePolicyStoreError) -> Self
fn from(err: UpdatePolicyStoreError) -> Self
Source§impl From<UpdatePolicyTemplateError> for Error
impl From<UpdatePolicyTemplateError> for Error
Source§fn from(err: UpdatePolicyTemplateError) -> Self
fn from(err: UpdatePolicyTemplateError) -> 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>
Returns self
with the
fg()
set to
Color::BrightBlack
.
§Example
println!("{}", value.bright_black());
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>
Returns self
with the
fg()
set to
Color::BrightGreen
.
§Example
println!("{}", value.bright_green());
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightYellow
.
§Example
println!("{}", value.bright_yellow());
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>
Returns self
with the
fg()
set to
Color::BrightMagenta
.
§Example
println!("{}", value.bright_magenta());
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>
Returns self
with the
fg()
set to
Color::BrightWhite
.
§Example
println!("{}", value.bright_white());
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>
Returns self
with the
bg()
set to
Color::BrightBlack
.
§Example
println!("{}", value.on_bright_black());
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>
Returns self
with the
bg()
set to
Color::BrightGreen
.
§Example
println!("{}", value.on_bright_green());
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightYellow
.
§Example
println!("{}", value.on_bright_yellow());
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightBlue
.
§Example
println!("{}", value.on_bright_blue());
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightMagenta
.
§Example
println!("{}", value.on_bright_magenta());
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightCyan
.
§Example
println!("{}", value.on_bright_cyan());
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightWhite
.
§Example
println!("{}", value.on_bright_white());
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 underline(&self) -> Painted<&T>
fn underline(&self) -> Painted<&T>
Returns self
with the
attr()
set to
Attribute::Underline
.
§Example
println!("{}", value.underline());
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Returns self
with the
attr()
set to
Attribute::RapidBlink
.
§Example
println!("{}", value.rapid_blink());
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);