#[non_exhaustive]pub enum Error {
AccessDeniedException(AccessDeniedException),
AgentsAlreadyRunningAssessmentException(AgentsAlreadyRunningAssessmentException),
AssessmentRunInProgressException(AssessmentRunInProgressException),
InternalException(InternalException),
InvalidCrossAccountRoleException(InvalidCrossAccountRoleException),
InvalidInputException(InvalidInputException),
LimitExceededException(LimitExceededException),
NoSuchEntityException(NoSuchEntityException),
PreviewGenerationInProgressException(PreviewGenerationInProgressException),
ServiceTemporarilyUnavailableException(ServiceTemporarilyUnavailableException),
UnsupportedFeatureException(UnsupportedFeatureException),
Unhandled(Unhandled),
}
Expand description
All possible error types for this service.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AccessDeniedException(AccessDeniedException)
You do not have required permissions to access the requested resource.
AgentsAlreadyRunningAssessmentException(AgentsAlreadyRunningAssessmentException)
You started an assessment run, but one of the instances is already participating in another assessment run.
AssessmentRunInProgressException(AssessmentRunInProgressException)
You cannot perform a specified action if an assessment run is currently in progress.
InternalException(InternalException)
Internal server error.
InvalidCrossAccountRoleException(InvalidCrossAccountRoleException)
Amazon Inspector cannot assume the cross-account role that it needs to list your EC2 instances during the assessment run.
InvalidInputException(InvalidInputException)
The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
LimitExceededException(LimitExceededException)
The request was rejected because it attempted to create resources beyond the current AWS account limits. The error code describes the limit exceeded.
NoSuchEntityException(NoSuchEntityException)
The request was rejected because it referenced an entity that does not exist. The error code describes the entity.
PreviewGenerationInProgressException(PreviewGenerationInProgressException)
The request is rejected. The specified assessment template is currently generating an exclusions preview.
The serice is temporary unavailable.
UnsupportedFeatureException(UnsupportedFeatureException)
Used by the GetAssessmentReport
API. The request was rejected because you tried to generate a report for an assessment run that existed before reporting was supported in Amazon Inspector. You can only generate reports for assessment runs that took place or will take place after generating reports in Amazon Inspector became available.
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<AddAttributesToFindingsError> for Error
impl From<AddAttributesToFindingsError> for Error
Source§fn from(err: AddAttributesToFindingsError) -> Self
fn from(err: AddAttributesToFindingsError) -> 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<CreateAssessmentTargetError> for Error
impl From<CreateAssessmentTargetError> for Error
Source§fn from(err: CreateAssessmentTargetError) -> Self
fn from(err: CreateAssessmentTargetError) -> Self
Source§impl From<CreateAssessmentTemplateError> for Error
impl From<CreateAssessmentTemplateError> for Error
Source§fn from(err: CreateAssessmentTemplateError) -> Self
fn from(err: CreateAssessmentTemplateError) -> Self
Source§impl From<CreateExclusionsPreviewError> for Error
impl From<CreateExclusionsPreviewError> for Error
Source§fn from(err: CreateExclusionsPreviewError) -> Self
fn from(err: CreateExclusionsPreviewError) -> Self
Source§impl From<CreateResourceGroupError> for Error
impl From<CreateResourceGroupError> for Error
Source§fn from(err: CreateResourceGroupError) -> Self
fn from(err: CreateResourceGroupError) -> Self
Source§impl From<DeleteAssessmentRunError> for Error
impl From<DeleteAssessmentRunError> for Error
Source§fn from(err: DeleteAssessmentRunError) -> Self
fn from(err: DeleteAssessmentRunError) -> Self
Source§impl From<DeleteAssessmentTargetError> for Error
impl From<DeleteAssessmentTargetError> for Error
Source§fn from(err: DeleteAssessmentTargetError) -> Self
fn from(err: DeleteAssessmentTargetError) -> Self
Source§impl From<DeleteAssessmentTemplateError> for Error
impl From<DeleteAssessmentTemplateError> for Error
Source§fn from(err: DeleteAssessmentTemplateError) -> Self
fn from(err: DeleteAssessmentTemplateError) -> Self
Source§impl From<DescribeAssessmentRunsError> for Error
impl From<DescribeAssessmentRunsError> for Error
Source§fn from(err: DescribeAssessmentRunsError) -> Self
fn from(err: DescribeAssessmentRunsError) -> Self
Source§impl From<DescribeAssessmentTargetsError> for Error
impl From<DescribeAssessmentTargetsError> for Error
Source§fn from(err: DescribeAssessmentTargetsError) -> Self
fn from(err: DescribeAssessmentTargetsError) -> Self
Source§impl From<DescribeAssessmentTemplatesError> for Error
impl From<DescribeAssessmentTemplatesError> for Error
Source§fn from(err: DescribeAssessmentTemplatesError) -> Self
fn from(err: DescribeAssessmentTemplatesError) -> Self
Source§impl From<DescribeCrossAccountAccessRoleError> for Error
impl From<DescribeCrossAccountAccessRoleError> for Error
Source§fn from(err: DescribeCrossAccountAccessRoleError) -> Self
fn from(err: DescribeCrossAccountAccessRoleError) -> Self
Source§impl From<DescribeExclusionsError> for Error
impl From<DescribeExclusionsError> for Error
Source§fn from(err: DescribeExclusionsError) -> Self
fn from(err: DescribeExclusionsError) -> Self
Source§impl From<DescribeFindingsError> for Error
impl From<DescribeFindingsError> for Error
Source§fn from(err: DescribeFindingsError) -> Self
fn from(err: DescribeFindingsError) -> Self
Source§impl From<DescribeResourceGroupsError> for Error
impl From<DescribeResourceGroupsError> for Error
Source§fn from(err: DescribeResourceGroupsError) -> Self
fn from(err: DescribeResourceGroupsError) -> Self
Source§impl From<DescribeRulesPackagesError> for Error
impl From<DescribeRulesPackagesError> for Error
Source§fn from(err: DescribeRulesPackagesError) -> Self
fn from(err: DescribeRulesPackagesError) -> Self
Source§impl From<GetAssessmentReportError> for Error
impl From<GetAssessmentReportError> for Error
Source§fn from(err: GetAssessmentReportError) -> Self
fn from(err: GetAssessmentReportError) -> Self
Source§impl From<GetExclusionsPreviewError> for Error
impl From<GetExclusionsPreviewError> for Error
Source§fn from(err: GetExclusionsPreviewError) -> Self
fn from(err: GetExclusionsPreviewError) -> Self
Source§impl From<GetTelemetryMetadataError> for Error
impl From<GetTelemetryMetadataError> for Error
Source§fn from(err: GetTelemetryMetadataError) -> Self
fn from(err: GetTelemetryMetadataError) -> Self
Source§impl From<ListAssessmentRunAgentsError> for Error
impl From<ListAssessmentRunAgentsError> for Error
Source§fn from(err: ListAssessmentRunAgentsError) -> Self
fn from(err: ListAssessmentRunAgentsError) -> Self
Source§impl From<ListAssessmentRunsError> for Error
impl From<ListAssessmentRunsError> for Error
Source§fn from(err: ListAssessmentRunsError) -> Self
fn from(err: ListAssessmentRunsError) -> Self
Source§impl From<ListAssessmentTargetsError> for Error
impl From<ListAssessmentTargetsError> for Error
Source§fn from(err: ListAssessmentTargetsError) -> Self
fn from(err: ListAssessmentTargetsError) -> Self
Source§impl From<ListAssessmentTemplatesError> for Error
impl From<ListAssessmentTemplatesError> for Error
Source§fn from(err: ListAssessmentTemplatesError) -> Self
fn from(err: ListAssessmentTemplatesError) -> Self
Source§impl From<ListEventSubscriptionsError> for Error
impl From<ListEventSubscriptionsError> for Error
Source§fn from(err: ListEventSubscriptionsError) -> Self
fn from(err: ListEventSubscriptionsError) -> Self
Source§impl From<ListExclusionsError> for Error
impl From<ListExclusionsError> for Error
Source§fn from(err: ListExclusionsError) -> Self
fn from(err: ListExclusionsError) -> Self
Source§impl From<ListFindingsError> for Error
impl From<ListFindingsError> for Error
Source§fn from(err: ListFindingsError) -> Self
fn from(err: ListFindingsError) -> Self
Source§impl From<ListRulesPackagesError> for Error
impl From<ListRulesPackagesError> for Error
Source§fn from(err: ListRulesPackagesError) -> Self
fn from(err: ListRulesPackagesError) -> 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<PreviewAgentsError> for Error
impl From<PreviewAgentsError> for Error
Source§fn from(err: PreviewAgentsError) -> Self
fn from(err: PreviewAgentsError) -> Self
Source§impl From<RegisterCrossAccountAccessRoleError> for Error
impl From<RegisterCrossAccountAccessRoleError> for Error
Source§fn from(err: RegisterCrossAccountAccessRoleError) -> Self
fn from(err: RegisterCrossAccountAccessRoleError) -> Self
Source§impl From<RemoveAttributesFromFindingsError> for Error
impl From<RemoveAttributesFromFindingsError> for Error
Source§fn from(err: RemoveAttributesFromFindingsError) -> Self
fn from(err: RemoveAttributesFromFindingsError) -> Self
Source§impl<R> From<SdkError<AddAttributesToFindingsError, R>> for Error
impl<R> From<SdkError<AddAttributesToFindingsError, R>> for Error
Source§fn from(err: SdkError<AddAttributesToFindingsError, R>) -> Self
fn from(err: SdkError<AddAttributesToFindingsError, R>) -> Self
Source§impl<R> From<SdkError<CreateAssessmentTargetError, R>> for Error
impl<R> From<SdkError<CreateAssessmentTargetError, R>> for Error
Source§fn from(err: SdkError<CreateAssessmentTargetError, R>) -> Self
fn from(err: SdkError<CreateAssessmentTargetError, R>) -> Self
Source§impl<R> From<SdkError<CreateAssessmentTemplateError, R>> for Error
impl<R> From<SdkError<CreateAssessmentTemplateError, R>> for Error
Source§fn from(err: SdkError<CreateAssessmentTemplateError, R>) -> Self
fn from(err: SdkError<CreateAssessmentTemplateError, R>) -> Self
Source§impl<R> From<SdkError<CreateExclusionsPreviewError, R>> for Error
impl<R> From<SdkError<CreateExclusionsPreviewError, R>> for Error
Source§fn from(err: SdkError<CreateExclusionsPreviewError, R>) -> Self
fn from(err: SdkError<CreateExclusionsPreviewError, R>) -> Self
Source§impl<R> From<SdkError<CreateResourceGroupError, R>> for Error
impl<R> From<SdkError<CreateResourceGroupError, R>> for Error
Source§fn from(err: SdkError<CreateResourceGroupError, R>) -> Self
fn from(err: SdkError<CreateResourceGroupError, R>) -> Self
Source§impl<R> From<SdkError<DeleteAssessmentRunError, R>> for Error
impl<R> From<SdkError<DeleteAssessmentRunError, R>> for Error
Source§fn from(err: SdkError<DeleteAssessmentRunError, R>) -> Self
fn from(err: SdkError<DeleteAssessmentRunError, R>) -> Self
Source§impl<R> From<SdkError<DeleteAssessmentTargetError, R>> for Error
impl<R> From<SdkError<DeleteAssessmentTargetError, R>> for Error
Source§fn from(err: SdkError<DeleteAssessmentTargetError, R>) -> Self
fn from(err: SdkError<DeleteAssessmentTargetError, R>) -> Self
Source§impl<R> From<SdkError<DeleteAssessmentTemplateError, R>> for Error
impl<R> From<SdkError<DeleteAssessmentTemplateError, R>> for Error
Source§fn from(err: SdkError<DeleteAssessmentTemplateError, R>) -> Self
fn from(err: SdkError<DeleteAssessmentTemplateError, R>) -> Self
Source§impl<R> From<SdkError<DescribeAssessmentRunsError, R>> for Error
impl<R> From<SdkError<DescribeAssessmentRunsError, R>> for Error
Source§fn from(err: SdkError<DescribeAssessmentRunsError, R>) -> Self
fn from(err: SdkError<DescribeAssessmentRunsError, R>) -> Self
Source§impl<R> From<SdkError<DescribeAssessmentTargetsError, R>> for Error
impl<R> From<SdkError<DescribeAssessmentTargetsError, R>> for Error
Source§fn from(err: SdkError<DescribeAssessmentTargetsError, R>) -> Self
fn from(err: SdkError<DescribeAssessmentTargetsError, R>) -> Self
Source§impl<R> From<SdkError<DescribeAssessmentTemplatesError, R>> for Error
impl<R> From<SdkError<DescribeAssessmentTemplatesError, R>> for Error
Source§fn from(err: SdkError<DescribeAssessmentTemplatesError, R>) -> Self
fn from(err: SdkError<DescribeAssessmentTemplatesError, R>) -> Self
Source§impl<R> From<SdkError<DescribeCrossAccountAccessRoleError, R>> for Error
impl<R> From<SdkError<DescribeCrossAccountAccessRoleError, R>> for Error
Source§fn from(err: SdkError<DescribeCrossAccountAccessRoleError, R>) -> Self
fn from(err: SdkError<DescribeCrossAccountAccessRoleError, R>) -> Self
Source§impl<R> From<SdkError<DescribeExclusionsError, R>> for Error
impl<R> From<SdkError<DescribeExclusionsError, R>> for Error
Source§fn from(err: SdkError<DescribeExclusionsError, R>) -> Self
fn from(err: SdkError<DescribeExclusionsError, R>) -> Self
Source§impl<R> From<SdkError<DescribeFindingsError, R>> for Error
impl<R> From<SdkError<DescribeFindingsError, R>> for Error
Source§fn from(err: SdkError<DescribeFindingsError, R>) -> Self
fn from(err: SdkError<DescribeFindingsError, R>) -> Self
Source§impl<R> From<SdkError<DescribeResourceGroupsError, R>> for Error
impl<R> From<SdkError<DescribeResourceGroupsError, R>> for Error
Source§fn from(err: SdkError<DescribeResourceGroupsError, R>) -> Self
fn from(err: SdkError<DescribeResourceGroupsError, R>) -> Self
Source§impl<R> From<SdkError<DescribeRulesPackagesError, R>> for Error
impl<R> From<SdkError<DescribeRulesPackagesError, R>> for Error
Source§fn from(err: SdkError<DescribeRulesPackagesError, R>) -> Self
fn from(err: SdkError<DescribeRulesPackagesError, R>) -> Self
Source§impl<R> From<SdkError<GetAssessmentReportError, R>> for Error
impl<R> From<SdkError<GetAssessmentReportError, R>> for Error
Source§fn from(err: SdkError<GetAssessmentReportError, R>) -> Self
fn from(err: SdkError<GetAssessmentReportError, R>) -> Self
Source§impl<R> From<SdkError<GetExclusionsPreviewError, R>> for Error
impl<R> From<SdkError<GetExclusionsPreviewError, R>> for Error
Source§fn from(err: SdkError<GetExclusionsPreviewError, R>) -> Self
fn from(err: SdkError<GetExclusionsPreviewError, R>) -> Self
Source§impl<R> From<SdkError<GetTelemetryMetadataError, R>> for Error
impl<R> From<SdkError<GetTelemetryMetadataError, R>> for Error
Source§fn from(err: SdkError<GetTelemetryMetadataError, R>) -> Self
fn from(err: SdkError<GetTelemetryMetadataError, R>) -> Self
Source§impl<R> From<SdkError<ListAssessmentRunAgentsError, R>> for Error
impl<R> From<SdkError<ListAssessmentRunAgentsError, R>> for Error
Source§fn from(err: SdkError<ListAssessmentRunAgentsError, R>) -> Self
fn from(err: SdkError<ListAssessmentRunAgentsError, R>) -> Self
Source§impl<R> From<SdkError<ListAssessmentRunsError, R>> for Error
impl<R> From<SdkError<ListAssessmentRunsError, R>> for Error
Source§fn from(err: SdkError<ListAssessmentRunsError, R>) -> Self
fn from(err: SdkError<ListAssessmentRunsError, R>) -> Self
Source§impl<R> From<SdkError<ListAssessmentTargetsError, R>> for Error
impl<R> From<SdkError<ListAssessmentTargetsError, R>> for Error
Source§fn from(err: SdkError<ListAssessmentTargetsError, R>) -> Self
fn from(err: SdkError<ListAssessmentTargetsError, R>) -> Self
Source§impl<R> From<SdkError<ListAssessmentTemplatesError, R>> for Error
impl<R> From<SdkError<ListAssessmentTemplatesError, R>> for Error
Source§fn from(err: SdkError<ListAssessmentTemplatesError, R>) -> Self
fn from(err: SdkError<ListAssessmentTemplatesError, R>) -> Self
Source§impl<R> From<SdkError<ListEventSubscriptionsError, R>> for Error
impl<R> From<SdkError<ListEventSubscriptionsError, R>> for Error
Source§fn from(err: SdkError<ListEventSubscriptionsError, R>) -> Self
fn from(err: SdkError<ListEventSubscriptionsError, R>) -> Self
Source§impl<R> From<SdkError<ListExclusionsError, R>> for Error
impl<R> From<SdkError<ListExclusionsError, R>> for Error
Source§fn from(err: SdkError<ListExclusionsError, R>) -> Self
fn from(err: SdkError<ListExclusionsError, R>) -> Self
Source§impl<R> From<SdkError<ListFindingsError, R>> for Error
impl<R> From<SdkError<ListFindingsError, R>> for Error
Source§fn from(err: SdkError<ListFindingsError, R>) -> Self
fn from(err: SdkError<ListFindingsError, R>) -> Self
Source§impl<R> From<SdkError<ListRulesPackagesError, R>> for Error
impl<R> From<SdkError<ListRulesPackagesError, R>> for Error
Source§fn from(err: SdkError<ListRulesPackagesError, R>) -> Self
fn from(err: SdkError<ListRulesPackagesError, 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<PreviewAgentsError, R>> for Error
impl<R> From<SdkError<PreviewAgentsError, R>> for Error
Source§fn from(err: SdkError<PreviewAgentsError, R>) -> Self
fn from(err: SdkError<PreviewAgentsError, R>) -> Self
Source§impl<R> From<SdkError<RegisterCrossAccountAccessRoleError, R>> for Error
impl<R> From<SdkError<RegisterCrossAccountAccessRoleError, R>> for Error
Source§fn from(err: SdkError<RegisterCrossAccountAccessRoleError, R>) -> Self
fn from(err: SdkError<RegisterCrossAccountAccessRoleError, R>) -> Self
Source§impl<R> From<SdkError<RemoveAttributesFromFindingsError, R>> for Error
impl<R> From<SdkError<RemoveAttributesFromFindingsError, R>> for Error
Source§fn from(err: SdkError<RemoveAttributesFromFindingsError, R>) -> Self
fn from(err: SdkError<RemoveAttributesFromFindingsError, R>) -> Self
Source§impl<R> From<SdkError<SetTagsForResourceError, R>> for Error
impl<R> From<SdkError<SetTagsForResourceError, R>> for Error
Source§fn from(err: SdkError<SetTagsForResourceError, R>) -> Self
fn from(err: SdkError<SetTagsForResourceError, R>) -> Self
Source§impl<R> From<SdkError<StartAssessmentRunError, R>> for Error
impl<R> From<SdkError<StartAssessmentRunError, R>> for Error
Source§fn from(err: SdkError<StartAssessmentRunError, R>) -> Self
fn from(err: SdkError<StartAssessmentRunError, R>) -> Self
Source§impl<R> From<SdkError<StopAssessmentRunError, R>> for Error
impl<R> From<SdkError<StopAssessmentRunError, R>> for Error
Source§fn from(err: SdkError<StopAssessmentRunError, R>) -> Self
fn from(err: SdkError<StopAssessmentRunError, R>) -> Self
Source§impl<R> From<SdkError<SubscribeToEventError, R>> for Error
impl<R> From<SdkError<SubscribeToEventError, R>> for Error
Source§fn from(err: SdkError<SubscribeToEventError, R>) -> Self
fn from(err: SdkError<SubscribeToEventError, R>) -> Self
Source§impl<R> From<SdkError<UnsubscribeFromEventError, R>> for Error
impl<R> From<SdkError<UnsubscribeFromEventError, R>> for Error
Source§fn from(err: SdkError<UnsubscribeFromEventError, R>) -> Self
fn from(err: SdkError<UnsubscribeFromEventError, R>) -> Self
Source§impl<R> From<SdkError<UpdateAssessmentTargetError, R>> for Error
impl<R> From<SdkError<UpdateAssessmentTargetError, R>> for Error
Source§fn from(err: SdkError<UpdateAssessmentTargetError, R>) -> Self
fn from(err: SdkError<UpdateAssessmentTargetError, R>) -> Self
Source§impl From<SetTagsForResourceError> for Error
impl From<SetTagsForResourceError> for Error
Source§fn from(err: SetTagsForResourceError) -> Self
fn from(err: SetTagsForResourceError) -> Self
Source§impl From<StartAssessmentRunError> for Error
impl From<StartAssessmentRunError> for Error
Source§fn from(err: StartAssessmentRunError) -> Self
fn from(err: StartAssessmentRunError) -> Self
Source§impl From<StopAssessmentRunError> for Error
impl From<StopAssessmentRunError> for Error
Source§fn from(err: StopAssessmentRunError) -> Self
fn from(err: StopAssessmentRunError) -> Self
Source§impl From<SubscribeToEventError> for Error
impl From<SubscribeToEventError> for Error
Source§fn from(err: SubscribeToEventError) -> Self
fn from(err: SubscribeToEventError) -> Self
Source§impl From<UnsubscribeFromEventError> for Error
impl From<UnsubscribeFromEventError> for Error
Source§fn from(err: UnsubscribeFromEventError) -> Self
fn from(err: UnsubscribeFromEventError) -> Self
Source§impl From<UpdateAssessmentTargetError> for Error
impl From<UpdateAssessmentTargetError> for Error
Source§fn from(err: UpdateAssessmentTargetError) -> Self
fn from(err: UpdateAssessmentTargetError) -> 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);