#[non_exhaustive]pub enum Error {
Show 29 variants
IdempotentParameterMismatchException(IdempotentParameterMismatchException),
InvalidClientTokenException(InvalidClientTokenException),
InvalidMaxResultsException(InvalidMaxResultsException),
InvalidNextTokenException(InvalidNextTokenException),
InvalidParameterException(InvalidParameterException),
InvalidPolicyException(InvalidPolicyException),
InvalidResourceTypeException(InvalidResourceTypeException),
InvalidStateTransitionException(InvalidStateTransitionException),
MalformedArnException(MalformedArnException),
MalformedPolicyTemplateException(MalformedPolicyTemplateException),
MissingRequiredParameterException(MissingRequiredParameterException),
OperationNotPermittedException(OperationNotPermittedException),
PermissionAlreadyExistsException(PermissionAlreadyExistsException),
PermissionLimitExceededException(PermissionLimitExceededException),
PermissionVersionsLimitExceededException(PermissionVersionsLimitExceededException),
ResourceArnNotFoundException(ResourceArnNotFoundException),
ResourceShareInvitationAlreadyAcceptedException(ResourceShareInvitationAlreadyAcceptedException),
ResourceShareInvitationAlreadyRejectedException(ResourceShareInvitationAlreadyRejectedException),
ResourceShareInvitationArnNotFoundException(ResourceShareInvitationArnNotFoundException),
ResourceShareInvitationExpiredException(ResourceShareInvitationExpiredException),
ResourceShareLimitExceededException(ResourceShareLimitExceededException),
ServerInternalException(ServerInternalException),
ServiceUnavailableException(ServiceUnavailableException),
TagLimitExceededException(TagLimitExceededException),
TagPolicyViolationException(TagPolicyViolationException),
ThrottlingException(ThrottlingException),
UnknownResourceException(UnknownResourceException),
UnmatchedPolicyPermissionException(UnmatchedPolicyPermissionException),
Unhandled(Unhandled),
}Expand description
All possible error types for this service.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
IdempotentParameterMismatchException(IdempotentParameterMismatchException)
The operation failed because the client token input parameter matched one that was used with a previous call to the operation, but at least one of the other input parameters is different from the previous call.
InvalidClientTokenException(InvalidClientTokenException)
The operation failed because the specified client token isn't valid.
InvalidMaxResultsException(InvalidMaxResultsException)
The operation failed because the specified value for MaxResults isn't valid.
InvalidNextTokenException(InvalidNextTokenException)
The operation failed because the specified value for NextToken isn't valid. You must specify a value you received in the NextToken response of a previous call to this operation.
InvalidParameterException(InvalidParameterException)
The operation failed because a parameter you specified isn't valid.
InvalidPolicyException(InvalidPolicyException)
The operation failed because a policy you specified isn't valid.
InvalidResourceTypeException(InvalidResourceTypeException)
The operation failed because the specified resource type isn't valid.
InvalidStateTransitionException(InvalidStateTransitionException)
The operation failed because the requested operation isn't valid for the resource share in its current state.
MalformedArnException(MalformedArnException)
The operation failed because the specified Amazon Resource Name (ARN) has a format that isn't valid.
MalformedPolicyTemplateException(MalformedPolicyTemplateException)
The operation failed because the policy template that you provided isn't valid.
MissingRequiredParameterException(MissingRequiredParameterException)
The operation failed because a required input parameter is missing.
OperationNotPermittedException(OperationNotPermittedException)
The operation failed because the requested operation isn't permitted.
PermissionAlreadyExistsException(PermissionAlreadyExistsException)
The operation failed because a permission with the specified name already exists in the requested Amazon Web Services Region. Choose a different name.
PermissionLimitExceededException(PermissionLimitExceededException)
The operation failed because it would exceed the maximum number of permissions you can create in each Amazon Web Services Region. To view the limits for your Amazon Web Services account, see the RAM page in the Service Quotas console.
PermissionVersionsLimitExceededException(PermissionVersionsLimitExceededException)
The operation failed because it would exceed the limit for the number of versions you can have for a permission. To view the limits for your Amazon Web Services account, see the RAM page in the Service Quotas console.
ResourceArnNotFoundException(ResourceArnNotFoundException)
The operation failed because the specified Amazon Resource Name (ARN) was not found.
The operation failed because the specified invitation was already accepted.
The operation failed because the specified invitation was already rejected.
The operation failed because the specified Amazon Resource Name (ARN) for an invitation was not found.
The operation failed because the specified invitation is past its expiration date and time.
The operation failed because it would exceed the limit for resource shares for your account. To view the limits for your Amazon Web Services account, see the RAM page in the Service Quotas console.
ServerInternalException(ServerInternalException)
The operation failed because the service could not respond to the request due to an internal problem. Try again later.
The operation failed because the service isn't available. Try again later.
TagLimitExceededException(TagLimitExceededException)
The operation failed because it would exceed the limit for tags for your Amazon Web Services account.
TagPolicyViolationException(TagPolicyViolationException)
The operation failed because the specified tag key is a reserved word and can't be used.
ThrottlingException(ThrottlingException)
The operation failed because it exceeded the rate at which you are allowed to perform this operation. Please try again later.
UnknownResourceException(UnknownResourceException)
The operation failed because a specified resource couldn't be found.
UnmatchedPolicyPermissionException(UnmatchedPolicyPermissionException)
There isn't an existing managed permission defined in RAM that has the same IAM permissions as the resource-based policy attached to the resource. You should first run PromotePermissionCreatedFromPolicy to create that managed permission.
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§fn from(err: AcceptResourceShareInvitationError) -> Self
fn from(err: AcceptResourceShareInvitationError) -> Self
Source§fn from(err: AssociateResourceShareError) -> Self
fn from(err: AssociateResourceShareError) -> Self
Source§fn from(err: AssociateResourceSharePermissionError) -> Self
fn from(err: AssociateResourceSharePermissionError) -> 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<CreatePermissionError> for Error
impl From<CreatePermissionError> for Error
Source§fn from(err: CreatePermissionError) -> Self
fn from(err: CreatePermissionError) -> Self
Source§impl From<CreatePermissionVersionError> for Error
impl From<CreatePermissionVersionError> for Error
Source§fn from(err: CreatePermissionVersionError) -> Self
fn from(err: CreatePermissionVersionError) -> Self
Source§fn from(err: CreateResourceShareError) -> Self
fn from(err: CreateResourceShareError) -> Self
Source§impl From<DeletePermissionError> for Error
impl From<DeletePermissionError> for Error
Source§fn from(err: DeletePermissionError) -> Self
fn from(err: DeletePermissionError) -> Self
Source§impl From<DeletePermissionVersionError> for Error
impl From<DeletePermissionVersionError> for Error
Source§fn from(err: DeletePermissionVersionError) -> Self
fn from(err: DeletePermissionVersionError) -> Self
Source§fn from(err: DeleteResourceShareError) -> Self
fn from(err: DeleteResourceShareError) -> Self
Source§fn from(err: DisassociateResourceShareError) -> Self
fn from(err: DisassociateResourceShareError) -> Self
Source§fn from(err: DisassociateResourceSharePermissionError) -> Self
fn from(err: DisassociateResourceSharePermissionError) -> Self
Source§impl From<EnableSharingWithAwsOrganizationError> for Error
impl From<EnableSharingWithAwsOrganizationError> for Error
Source§fn from(err: EnableSharingWithAwsOrganizationError) -> Self
fn from(err: EnableSharingWithAwsOrganizationError) -> Self
Source§impl From<GetPermissionError> for Error
impl From<GetPermissionError> for Error
Source§fn from(err: GetPermissionError) -> Self
fn from(err: GetPermissionError) -> Self
Source§impl From<GetResourcePoliciesError> for Error
impl From<GetResourcePoliciesError> for Error
Source§fn from(err: GetResourcePoliciesError) -> Self
fn from(err: GetResourcePoliciesError) -> Self
Source§fn from(err: GetResourceShareAssociationsError) -> Self
fn from(err: GetResourceShareAssociationsError) -> Self
Source§fn from(err: GetResourceShareInvitationsError) -> Self
fn from(err: GetResourceShareInvitationsError) -> Self
Source§fn from(err: GetResourceSharesError) -> Self
fn from(err: GetResourceSharesError) -> Self
Source§impl From<ListPendingInvitationResourcesError> for Error
impl From<ListPendingInvitationResourcesError> for Error
Source§fn from(err: ListPendingInvitationResourcesError) -> Self
fn from(err: ListPendingInvitationResourcesError) -> Self
Source§impl From<ListPermissionAssociationsError> for Error
impl From<ListPermissionAssociationsError> for Error
Source§fn from(err: ListPermissionAssociationsError) -> Self
fn from(err: ListPermissionAssociationsError) -> Self
Source§impl From<ListPermissionVersionsError> for Error
impl From<ListPermissionVersionsError> for Error
Source§fn from(err: ListPermissionVersionsError) -> Self
fn from(err: ListPermissionVersionsError) -> Self
Source§impl From<ListPermissionsError> for Error
impl From<ListPermissionsError> for Error
Source§fn from(err: ListPermissionsError) -> Self
fn from(err: ListPermissionsError) -> Self
Source§impl From<ListPrincipalsError> for Error
impl From<ListPrincipalsError> for Error
Source§fn from(err: ListPrincipalsError) -> Self
fn from(err: ListPrincipalsError) -> Self
Source§impl From<ListReplacePermissionAssociationsWorkError> for Error
impl From<ListReplacePermissionAssociationsWorkError> for Error
Source§fn from(err: ListReplacePermissionAssociationsWorkError) -> Self
fn from(err: ListReplacePermissionAssociationsWorkError) -> Self
Source§fn from(err: ListResourceSharePermissionsError) -> Self
fn from(err: ListResourceSharePermissionsError) -> Self
Source§impl From<ListResourceTypesError> for Error
impl From<ListResourceTypesError> for Error
Source§fn from(err: ListResourceTypesError) -> Self
fn from(err: ListResourceTypesError) -> Self
Source§impl From<ListResourcesError> for Error
impl From<ListResourcesError> for Error
Source§fn from(err: ListResourcesError) -> Self
fn from(err: ListResourcesError) -> Self
Source§impl From<PromotePermissionCreatedFromPolicyError> for Error
impl From<PromotePermissionCreatedFromPolicyError> for Error
Source§fn from(err: PromotePermissionCreatedFromPolicyError) -> Self
fn from(err: PromotePermissionCreatedFromPolicyError) -> Self
Source§fn from(err: PromoteResourceShareCreatedFromPolicyError) -> Self
fn from(err: PromoteResourceShareCreatedFromPolicyError) -> Self
Source§fn from(err: RejectResourceShareInvitationError) -> Self
fn from(err: RejectResourceShareInvitationError) -> Self
Source§impl From<ReplacePermissionAssociationsError> for Error
impl From<ReplacePermissionAssociationsError> for Error
Source§fn from(err: ReplacePermissionAssociationsError) -> Self
fn from(err: ReplacePermissionAssociationsError) -> Self
Source§fn from(err: SdkError<AcceptResourceShareInvitationError, R>) -> Self
fn from(err: SdkError<AcceptResourceShareInvitationError, R>) -> Self
Source§fn from(err: SdkError<AssociateResourceShareError, R>) -> Self
fn from(err: SdkError<AssociateResourceShareError, R>) -> Self
Source§fn from(err: SdkError<AssociateResourceSharePermissionError, R>) -> Self
fn from(err: SdkError<AssociateResourceSharePermissionError, R>) -> Self
Source§impl<R> From<SdkError<CreatePermissionError, R>> for Error
impl<R> From<SdkError<CreatePermissionError, R>> for Error
Source§fn from(err: SdkError<CreatePermissionError, R>) -> Self
fn from(err: SdkError<CreatePermissionError, R>) -> Self
Source§impl<R> From<SdkError<CreatePermissionVersionError, R>> for Error
impl<R> From<SdkError<CreatePermissionVersionError, R>> for Error
Source§fn from(err: SdkError<CreatePermissionVersionError, R>) -> Self
fn from(err: SdkError<CreatePermissionVersionError, R>) -> Self
Source§fn from(err: SdkError<CreateResourceShareError, R>) -> Self
fn from(err: SdkError<CreateResourceShareError, R>) -> Self
Source§impl<R> From<SdkError<DeletePermissionError, R>> for Error
impl<R> From<SdkError<DeletePermissionError, R>> for Error
Source§fn from(err: SdkError<DeletePermissionError, R>) -> Self
fn from(err: SdkError<DeletePermissionError, R>) -> Self
Source§impl<R> From<SdkError<DeletePermissionVersionError, R>> for Error
impl<R> From<SdkError<DeletePermissionVersionError, R>> for Error
Source§fn from(err: SdkError<DeletePermissionVersionError, R>) -> Self
fn from(err: SdkError<DeletePermissionVersionError, R>) -> Self
Source§fn from(err: SdkError<DeleteResourceShareError, R>) -> Self
fn from(err: SdkError<DeleteResourceShareError, R>) -> Self
Source§fn from(err: SdkError<DisassociateResourceShareError, R>) -> Self
fn from(err: SdkError<DisassociateResourceShareError, R>) -> Self
Source§fn from(err: SdkError<DisassociateResourceSharePermissionError, R>) -> Self
fn from(err: SdkError<DisassociateResourceSharePermissionError, R>) -> Self
Source§impl<R> From<SdkError<EnableSharingWithAwsOrganizationError, R>> for Error
impl<R> From<SdkError<EnableSharingWithAwsOrganizationError, R>> for Error
Source§fn from(err: SdkError<EnableSharingWithAwsOrganizationError, R>) -> Self
fn from(err: SdkError<EnableSharingWithAwsOrganizationError, R>) -> Self
Source§impl<R> From<SdkError<GetPermissionError, R>> for Error
impl<R> From<SdkError<GetPermissionError, R>> for Error
Source§fn from(err: SdkError<GetPermissionError, R>) -> Self
fn from(err: SdkError<GetPermissionError, R>) -> Self
Source§impl<R> From<SdkError<GetResourcePoliciesError, R>> for Error
impl<R> From<SdkError<GetResourcePoliciesError, R>> for Error
Source§fn from(err: SdkError<GetResourcePoliciesError, R>) -> Self
fn from(err: SdkError<GetResourcePoliciesError, R>) -> Self
Source§fn from(err: SdkError<GetResourceShareAssociationsError, R>) -> Self
fn from(err: SdkError<GetResourceShareAssociationsError, R>) -> Self
Source§fn from(err: SdkError<GetResourceShareInvitationsError, R>) -> Self
fn from(err: SdkError<GetResourceShareInvitationsError, R>) -> Self
Source§fn from(err: SdkError<GetResourceSharesError, R>) -> Self
fn from(err: SdkError<GetResourceSharesError, R>) -> Self
Source§impl<R> From<SdkError<ListPendingInvitationResourcesError, R>> for Error
impl<R> From<SdkError<ListPendingInvitationResourcesError, R>> for Error
Source§fn from(err: SdkError<ListPendingInvitationResourcesError, R>) -> Self
fn from(err: SdkError<ListPendingInvitationResourcesError, R>) -> Self
Source§impl<R> From<SdkError<ListPermissionAssociationsError, R>> for Error
impl<R> From<SdkError<ListPermissionAssociationsError, R>> for Error
Source§fn from(err: SdkError<ListPermissionAssociationsError, R>) -> Self
fn from(err: SdkError<ListPermissionAssociationsError, R>) -> Self
Source§impl<R> From<SdkError<ListPermissionVersionsError, R>> for Error
impl<R> From<SdkError<ListPermissionVersionsError, R>> for Error
Source§fn from(err: SdkError<ListPermissionVersionsError, R>) -> Self
fn from(err: SdkError<ListPermissionVersionsError, R>) -> Self
Source§impl<R> From<SdkError<ListPermissionsError, R>> for Error
impl<R> From<SdkError<ListPermissionsError, R>> for Error
Source§fn from(err: SdkError<ListPermissionsError, R>) -> Self
fn from(err: SdkError<ListPermissionsError, R>) -> Self
Source§impl<R> From<SdkError<ListPrincipalsError, R>> for Error
impl<R> From<SdkError<ListPrincipalsError, R>> for Error
Source§fn from(err: SdkError<ListPrincipalsError, R>) -> Self
fn from(err: SdkError<ListPrincipalsError, R>) -> Self
Source§impl<R> From<SdkError<ListReplacePermissionAssociationsWorkError, R>> for Error
impl<R> From<SdkError<ListReplacePermissionAssociationsWorkError, R>> for Error
Source§fn from(err: SdkError<ListReplacePermissionAssociationsWorkError, R>) -> Self
fn from(err: SdkError<ListReplacePermissionAssociationsWorkError, R>) -> Self
Source§fn from(err: SdkError<ListResourceSharePermissionsError, R>) -> Self
fn from(err: SdkError<ListResourceSharePermissionsError, R>) -> Self
Source§impl<R> From<SdkError<ListResourceTypesError, R>> for Error
impl<R> From<SdkError<ListResourceTypesError, R>> for Error
Source§fn from(err: SdkError<ListResourceTypesError, R>) -> Self
fn from(err: SdkError<ListResourceTypesError, R>) -> Self
Source§impl<R> From<SdkError<ListResourcesError, R>> for Error
impl<R> From<SdkError<ListResourcesError, R>> for Error
Source§fn from(err: SdkError<ListResourcesError, R>) -> Self
fn from(err: SdkError<ListResourcesError, R>) -> Self
Source§impl<R> From<SdkError<PromotePermissionCreatedFromPolicyError, R>> for Error
impl<R> From<SdkError<PromotePermissionCreatedFromPolicyError, R>> for Error
Source§fn from(err: SdkError<PromotePermissionCreatedFromPolicyError, R>) -> Self
fn from(err: SdkError<PromotePermissionCreatedFromPolicyError, R>) -> Self
Source§fn from(err: SdkError<PromoteResourceShareCreatedFromPolicyError, R>) -> Self
fn from(err: SdkError<PromoteResourceShareCreatedFromPolicyError, R>) -> Self
Source§fn from(err: SdkError<RejectResourceShareInvitationError, R>) -> Self
fn from(err: SdkError<RejectResourceShareInvitationError, R>) -> Self
Source§impl<R> From<SdkError<ReplacePermissionAssociationsError, R>> for Error
impl<R> From<SdkError<ReplacePermissionAssociationsError, R>> for Error
Source§fn from(err: SdkError<ReplacePermissionAssociationsError, R>) -> Self
fn from(err: SdkError<ReplacePermissionAssociationsError, R>) -> Self
Source§impl<R> From<SdkError<SetDefaultPermissionVersionError, R>> for Error
impl<R> From<SdkError<SetDefaultPermissionVersionError, R>> for Error
Source§fn from(err: SdkError<SetDefaultPermissionVersionError, R>) -> Self
fn from(err: SdkError<SetDefaultPermissionVersionError, 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§fn from(err: SdkError<UpdateResourceShareError, R>) -> Self
fn from(err: SdkError<UpdateResourceShareError, R>) -> Self
Source§impl From<SetDefaultPermissionVersionError> for Error
impl From<SetDefaultPermissionVersionError> for Error
Source§fn from(err: SetDefaultPermissionVersionError) -> Self
fn from(err: SetDefaultPermissionVersionError) -> 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§fn from(err: UpdateResourceShareError) -> Self
fn from(err: UpdateResourceShareError) -> 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);