#[non_exhaustive]pub enum Error {
Show 15 variants
ConcurrentModificationException(ConcurrentModificationException),
ConflictException(ConflictException),
DashboardInvalidInputError(DashboardInvalidInputError),
DashboardNotFoundError(DashboardNotFoundError),
InternalServiceFault(InternalServiceFault),
InvalidFormatFault(InvalidFormatFault),
InvalidNextToken(InvalidNextToken),
InvalidParameterCombinationException(InvalidParameterCombinationException),
InvalidParameterValueException(InvalidParameterValueException),
LimitExceededException(LimitExceededException),
LimitExceededFault(LimitExceededFault),
MissingRequiredParameterException(MissingRequiredParameterException),
ResourceNotFound(ResourceNotFound),
ResourceNotFoundException(ResourceNotFoundException),
Unhandled(Unhandled),
}
Expand description
All possible error types for this service.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ConcurrentModificationException(ConcurrentModificationException)
More than one process tried to modify a resource at the same time.
ConflictException(ConflictException)
This operation attempted to create a resource that already exists.
DashboardInvalidInputError(DashboardInvalidInputError)
Some part of the dashboard data is invalid.
DashboardNotFoundError(DashboardNotFoundError)
The specified dashboard does not exist.
InternalServiceFault(InternalServiceFault)
Request processing has failed due to some unknown error, exception, or failure.
InvalidFormatFault(InvalidFormatFault)
Data was not syntactically valid JSON.
InvalidNextToken(InvalidNextToken)
The next token specified is invalid.
InvalidParameterCombinationException(InvalidParameterCombinationException)
Parameters were used together that cannot be used together.
InvalidParameterValueException(InvalidParameterValueException)
The value of an input parameter is bad or out-of-range.
LimitExceededException(LimitExceededException)
The operation exceeded one or more limits.
LimitExceededFault(LimitExceededFault)
The quota for alarms for this customer has already been reached.
MissingRequiredParameterException(MissingRequiredParameterException)
An input parameter that is required is missing.
ResourceNotFound(ResourceNotFound)
The named resource does not exist.
ResourceNotFoundException(ResourceNotFoundException)
The named resource does not exist.
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<DeleteAlarmsError> for Error
impl From<DeleteAlarmsError> for Error
Source§fn from(err: DeleteAlarmsError) -> Self
fn from(err: DeleteAlarmsError) -> Self
Source§impl From<DeleteAnomalyDetectorError> for Error
impl From<DeleteAnomalyDetectorError> for Error
Source§fn from(err: DeleteAnomalyDetectorError) -> Self
fn from(err: DeleteAnomalyDetectorError) -> Self
Source§impl From<DeleteDashboardsError> for Error
impl From<DeleteDashboardsError> for Error
Source§fn from(err: DeleteDashboardsError) -> Self
fn from(err: DeleteDashboardsError) -> Self
Source§impl From<DeleteInsightRulesError> for Error
impl From<DeleteInsightRulesError> for Error
Source§fn from(err: DeleteInsightRulesError) -> Self
fn from(err: DeleteInsightRulesError) -> Self
Source§impl From<DeleteMetricStreamError> for Error
impl From<DeleteMetricStreamError> for Error
Source§fn from(err: DeleteMetricStreamError) -> Self
fn from(err: DeleteMetricStreamError) -> Self
Source§impl From<DescribeAlarmContributorsError> for Error
impl From<DescribeAlarmContributorsError> for Error
Source§fn from(err: DescribeAlarmContributorsError) -> Self
fn from(err: DescribeAlarmContributorsError) -> Self
Source§impl From<DescribeAlarmHistoryError> for Error
impl From<DescribeAlarmHistoryError> for Error
Source§fn from(err: DescribeAlarmHistoryError) -> Self
fn from(err: DescribeAlarmHistoryError) -> Self
Source§impl From<DescribeAlarmsError> for Error
impl From<DescribeAlarmsError> for Error
Source§fn from(err: DescribeAlarmsError) -> Self
fn from(err: DescribeAlarmsError) -> Self
Source§impl From<DescribeAlarmsForMetricError> for Error
impl From<DescribeAlarmsForMetricError> for Error
Source§fn from(err: DescribeAlarmsForMetricError) -> Self
fn from(err: DescribeAlarmsForMetricError) -> Self
Source§impl From<DescribeAnomalyDetectorsError> for Error
impl From<DescribeAnomalyDetectorsError> for Error
Source§fn from(err: DescribeAnomalyDetectorsError) -> Self
fn from(err: DescribeAnomalyDetectorsError) -> Self
Source§impl From<DescribeInsightRulesError> for Error
impl From<DescribeInsightRulesError> for Error
Source§fn from(err: DescribeInsightRulesError) -> Self
fn from(err: DescribeInsightRulesError) -> Self
Source§impl From<DisableAlarmActionsError> for Error
impl From<DisableAlarmActionsError> for Error
Source§fn from(err: DisableAlarmActionsError) -> Self
fn from(err: DisableAlarmActionsError) -> Self
Source§impl From<DisableInsightRulesError> for Error
impl From<DisableInsightRulesError> for Error
Source§fn from(err: DisableInsightRulesError) -> Self
fn from(err: DisableInsightRulesError) -> Self
Source§impl From<EnableAlarmActionsError> for Error
impl From<EnableAlarmActionsError> for Error
Source§fn from(err: EnableAlarmActionsError) -> Self
fn from(err: EnableAlarmActionsError) -> Self
Source§impl From<EnableInsightRulesError> for Error
impl From<EnableInsightRulesError> for Error
Source§fn from(err: EnableInsightRulesError) -> Self
fn from(err: EnableInsightRulesError) -> Self
Source§impl From<GetDashboardError> for Error
impl From<GetDashboardError> for Error
Source§fn from(err: GetDashboardError) -> Self
fn from(err: GetDashboardError) -> Self
Source§impl From<GetInsightRuleReportError> for Error
impl From<GetInsightRuleReportError> for Error
Source§fn from(err: GetInsightRuleReportError) -> Self
fn from(err: GetInsightRuleReportError) -> Self
Source§impl From<GetMetricDataError> for Error
impl From<GetMetricDataError> for Error
Source§fn from(err: GetMetricDataError) -> Self
fn from(err: GetMetricDataError) -> Self
Source§impl From<GetMetricStatisticsError> for Error
impl From<GetMetricStatisticsError> for Error
Source§fn from(err: GetMetricStatisticsError) -> Self
fn from(err: GetMetricStatisticsError) -> Self
Source§impl From<GetMetricStreamError> for Error
impl From<GetMetricStreamError> for Error
Source§fn from(err: GetMetricStreamError) -> Self
fn from(err: GetMetricStreamError) -> Self
Source§impl From<GetMetricWidgetImageError> for Error
impl From<GetMetricWidgetImageError> for Error
Source§fn from(err: GetMetricWidgetImageError) -> Self
fn from(err: GetMetricWidgetImageError) -> Self
Source§impl From<ListDashboardsError> for Error
impl From<ListDashboardsError> for Error
Source§fn from(err: ListDashboardsError) -> Self
fn from(err: ListDashboardsError) -> Self
Source§impl From<ListManagedInsightRulesError> for Error
impl From<ListManagedInsightRulesError> for Error
Source§fn from(err: ListManagedInsightRulesError) -> Self
fn from(err: ListManagedInsightRulesError) -> Self
Source§impl From<ListMetricStreamsError> for Error
impl From<ListMetricStreamsError> for Error
Source§fn from(err: ListMetricStreamsError) -> Self
fn from(err: ListMetricStreamsError) -> Self
Source§impl From<ListMetricsError> for Error
impl From<ListMetricsError> for Error
Source§fn from(err: ListMetricsError) -> Self
fn from(err: ListMetricsError) -> 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<PutAnomalyDetectorError> for Error
impl From<PutAnomalyDetectorError> for Error
Source§fn from(err: PutAnomalyDetectorError) -> Self
fn from(err: PutAnomalyDetectorError) -> Self
Source§impl From<PutCompositeAlarmError> for Error
impl From<PutCompositeAlarmError> for Error
Source§fn from(err: PutCompositeAlarmError) -> Self
fn from(err: PutCompositeAlarmError) -> Self
Source§impl From<PutDashboardError> for Error
impl From<PutDashboardError> for Error
Source§fn from(err: PutDashboardError) -> Self
fn from(err: PutDashboardError) -> Self
Source§impl From<PutInsightRuleError> for Error
impl From<PutInsightRuleError> for Error
Source§fn from(err: PutInsightRuleError) -> Self
fn from(err: PutInsightRuleError) -> Self
Source§impl From<PutManagedInsightRulesError> for Error
impl From<PutManagedInsightRulesError> for Error
Source§fn from(err: PutManagedInsightRulesError) -> Self
fn from(err: PutManagedInsightRulesError) -> Self
Source§impl From<PutMetricAlarmError> for Error
impl From<PutMetricAlarmError> for Error
Source§fn from(err: PutMetricAlarmError) -> Self
fn from(err: PutMetricAlarmError) -> Self
Source§impl From<PutMetricDataError> for Error
impl From<PutMetricDataError> for Error
Source§fn from(err: PutMetricDataError) -> Self
fn from(err: PutMetricDataError) -> Self
Source§impl From<PutMetricStreamError> for Error
impl From<PutMetricStreamError> for Error
Source§fn from(err: PutMetricStreamError) -> Self
fn from(err: PutMetricStreamError) -> Self
Source§impl<R> From<SdkError<DeleteAlarmsError, R>> for Error
impl<R> From<SdkError<DeleteAlarmsError, R>> for Error
Source§fn from(err: SdkError<DeleteAlarmsError, R>) -> Self
fn from(err: SdkError<DeleteAlarmsError, R>) -> Self
Source§impl<R> From<SdkError<DeleteAnomalyDetectorError, R>> for Error
impl<R> From<SdkError<DeleteAnomalyDetectorError, R>> for Error
Source§fn from(err: SdkError<DeleteAnomalyDetectorError, R>) -> Self
fn from(err: SdkError<DeleteAnomalyDetectorError, R>) -> Self
Source§impl<R> From<SdkError<DeleteDashboardsError, R>> for Error
impl<R> From<SdkError<DeleteDashboardsError, R>> for Error
Source§fn from(err: SdkError<DeleteDashboardsError, R>) -> Self
fn from(err: SdkError<DeleteDashboardsError, R>) -> Self
Source§impl<R> From<SdkError<DeleteInsightRulesError, R>> for Error
impl<R> From<SdkError<DeleteInsightRulesError, R>> for Error
Source§fn from(err: SdkError<DeleteInsightRulesError, R>) -> Self
fn from(err: SdkError<DeleteInsightRulesError, R>) -> Self
Source§impl<R> From<SdkError<DeleteMetricStreamError, R>> for Error
impl<R> From<SdkError<DeleteMetricStreamError, R>> for Error
Source§fn from(err: SdkError<DeleteMetricStreamError, R>) -> Self
fn from(err: SdkError<DeleteMetricStreamError, R>) -> Self
Source§impl<R> From<SdkError<DescribeAlarmContributorsError, R>> for Error
impl<R> From<SdkError<DescribeAlarmContributorsError, R>> for Error
Source§fn from(err: SdkError<DescribeAlarmContributorsError, R>) -> Self
fn from(err: SdkError<DescribeAlarmContributorsError, R>) -> Self
Source§impl<R> From<SdkError<DescribeAlarmHistoryError, R>> for Error
impl<R> From<SdkError<DescribeAlarmHistoryError, R>> for Error
Source§fn from(err: SdkError<DescribeAlarmHistoryError, R>) -> Self
fn from(err: SdkError<DescribeAlarmHistoryError, R>) -> Self
Source§impl<R> From<SdkError<DescribeAlarmsError, R>> for Error
impl<R> From<SdkError<DescribeAlarmsError, R>> for Error
Source§fn from(err: SdkError<DescribeAlarmsError, R>) -> Self
fn from(err: SdkError<DescribeAlarmsError, R>) -> Self
Source§impl<R> From<SdkError<DescribeAlarmsForMetricError, R>> for Error
impl<R> From<SdkError<DescribeAlarmsForMetricError, R>> for Error
Source§fn from(err: SdkError<DescribeAlarmsForMetricError, R>) -> Self
fn from(err: SdkError<DescribeAlarmsForMetricError, R>) -> Self
Source§impl<R> From<SdkError<DescribeAnomalyDetectorsError, R>> for Error
impl<R> From<SdkError<DescribeAnomalyDetectorsError, R>> for Error
Source§fn from(err: SdkError<DescribeAnomalyDetectorsError, R>) -> Self
fn from(err: SdkError<DescribeAnomalyDetectorsError, R>) -> Self
Source§impl<R> From<SdkError<DescribeInsightRulesError, R>> for Error
impl<R> From<SdkError<DescribeInsightRulesError, R>> for Error
Source§fn from(err: SdkError<DescribeInsightRulesError, R>) -> Self
fn from(err: SdkError<DescribeInsightRulesError, R>) -> Self
Source§impl<R> From<SdkError<DisableAlarmActionsError, R>> for Error
impl<R> From<SdkError<DisableAlarmActionsError, R>> for Error
Source§fn from(err: SdkError<DisableAlarmActionsError, R>) -> Self
fn from(err: SdkError<DisableAlarmActionsError, R>) -> Self
Source§impl<R> From<SdkError<DisableInsightRulesError, R>> for Error
impl<R> From<SdkError<DisableInsightRulesError, R>> for Error
Source§fn from(err: SdkError<DisableInsightRulesError, R>) -> Self
fn from(err: SdkError<DisableInsightRulesError, R>) -> Self
Source§impl<R> From<SdkError<EnableAlarmActionsError, R>> for Error
impl<R> From<SdkError<EnableAlarmActionsError, R>> for Error
Source§fn from(err: SdkError<EnableAlarmActionsError, R>) -> Self
fn from(err: SdkError<EnableAlarmActionsError, R>) -> Self
Source§impl<R> From<SdkError<EnableInsightRulesError, R>> for Error
impl<R> From<SdkError<EnableInsightRulesError, R>> for Error
Source§fn from(err: SdkError<EnableInsightRulesError, R>) -> Self
fn from(err: SdkError<EnableInsightRulesError, R>) -> Self
Source§impl<R> From<SdkError<GetDashboardError, R>> for Error
impl<R> From<SdkError<GetDashboardError, R>> for Error
Source§fn from(err: SdkError<GetDashboardError, R>) -> Self
fn from(err: SdkError<GetDashboardError, R>) -> Self
Source§impl<R> From<SdkError<GetInsightRuleReportError, R>> for Error
impl<R> From<SdkError<GetInsightRuleReportError, R>> for Error
Source§fn from(err: SdkError<GetInsightRuleReportError, R>) -> Self
fn from(err: SdkError<GetInsightRuleReportError, R>) -> Self
Source§impl<R> From<SdkError<GetMetricDataError, R>> for Error
impl<R> From<SdkError<GetMetricDataError, R>> for Error
Source§fn from(err: SdkError<GetMetricDataError, R>) -> Self
fn from(err: SdkError<GetMetricDataError, R>) -> Self
Source§impl<R> From<SdkError<GetMetricStatisticsError, R>> for Error
impl<R> From<SdkError<GetMetricStatisticsError, R>> for Error
Source§fn from(err: SdkError<GetMetricStatisticsError, R>) -> Self
fn from(err: SdkError<GetMetricStatisticsError, R>) -> Self
Source§impl<R> From<SdkError<GetMetricStreamError, R>> for Error
impl<R> From<SdkError<GetMetricStreamError, R>> for Error
Source§fn from(err: SdkError<GetMetricStreamError, R>) -> Self
fn from(err: SdkError<GetMetricStreamError, R>) -> Self
Source§impl<R> From<SdkError<GetMetricWidgetImageError, R>> for Error
impl<R> From<SdkError<GetMetricWidgetImageError, R>> for Error
Source§fn from(err: SdkError<GetMetricWidgetImageError, R>) -> Self
fn from(err: SdkError<GetMetricWidgetImageError, R>) -> Self
Source§impl<R> From<SdkError<ListDashboardsError, R>> for Error
impl<R> From<SdkError<ListDashboardsError, R>> for Error
Source§fn from(err: SdkError<ListDashboardsError, R>) -> Self
fn from(err: SdkError<ListDashboardsError, R>) -> Self
Source§impl<R> From<SdkError<ListManagedInsightRulesError, R>> for Error
impl<R> From<SdkError<ListManagedInsightRulesError, R>> for Error
Source§fn from(err: SdkError<ListManagedInsightRulesError, R>) -> Self
fn from(err: SdkError<ListManagedInsightRulesError, R>) -> Self
Source§impl<R> From<SdkError<ListMetricStreamsError, R>> for Error
impl<R> From<SdkError<ListMetricStreamsError, R>> for Error
Source§fn from(err: SdkError<ListMetricStreamsError, R>) -> Self
fn from(err: SdkError<ListMetricStreamsError, R>) -> Self
Source§impl<R> From<SdkError<ListMetricsError, R>> for Error
impl<R> From<SdkError<ListMetricsError, R>> for Error
Source§fn from(err: SdkError<ListMetricsError, R>) -> Self
fn from(err: SdkError<ListMetricsError, 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<PutAnomalyDetectorError, R>> for Error
impl<R> From<SdkError<PutAnomalyDetectorError, R>> for Error
Source§fn from(err: SdkError<PutAnomalyDetectorError, R>) -> Self
fn from(err: SdkError<PutAnomalyDetectorError, R>) -> Self
Source§impl<R> From<SdkError<PutCompositeAlarmError, R>> for Error
impl<R> From<SdkError<PutCompositeAlarmError, R>> for Error
Source§fn from(err: SdkError<PutCompositeAlarmError, R>) -> Self
fn from(err: SdkError<PutCompositeAlarmError, R>) -> Self
Source§impl<R> From<SdkError<PutDashboardError, R>> for Error
impl<R> From<SdkError<PutDashboardError, R>> for Error
Source§fn from(err: SdkError<PutDashboardError, R>) -> Self
fn from(err: SdkError<PutDashboardError, R>) -> Self
Source§impl<R> From<SdkError<PutInsightRuleError, R>> for Error
impl<R> From<SdkError<PutInsightRuleError, R>> for Error
Source§fn from(err: SdkError<PutInsightRuleError, R>) -> Self
fn from(err: SdkError<PutInsightRuleError, R>) -> Self
Source§impl<R> From<SdkError<PutManagedInsightRulesError, R>> for Error
impl<R> From<SdkError<PutManagedInsightRulesError, R>> for Error
Source§fn from(err: SdkError<PutManagedInsightRulesError, R>) -> Self
fn from(err: SdkError<PutManagedInsightRulesError, R>) -> Self
Source§impl<R> From<SdkError<PutMetricAlarmError, R>> for Error
impl<R> From<SdkError<PutMetricAlarmError, R>> for Error
Source§fn from(err: SdkError<PutMetricAlarmError, R>) -> Self
fn from(err: SdkError<PutMetricAlarmError, R>) -> Self
Source§impl<R> From<SdkError<PutMetricDataError, R>> for Error
impl<R> From<SdkError<PutMetricDataError, R>> for Error
Source§fn from(err: SdkError<PutMetricDataError, R>) -> Self
fn from(err: SdkError<PutMetricDataError, R>) -> Self
Source§impl<R> From<SdkError<PutMetricStreamError, R>> for Error
impl<R> From<SdkError<PutMetricStreamError, R>> for Error
Source§fn from(err: SdkError<PutMetricStreamError, R>) -> Self
fn from(err: SdkError<PutMetricStreamError, R>) -> Self
Source§impl<R> From<SdkError<SetAlarmStateError, R>> for Error
impl<R> From<SdkError<SetAlarmStateError, R>> for Error
Source§fn from(err: SdkError<SetAlarmStateError, R>) -> Self
fn from(err: SdkError<SetAlarmStateError, R>) -> Self
Source§impl<R> From<SdkError<StartMetricStreamsError, R>> for Error
impl<R> From<SdkError<StartMetricStreamsError, R>> for Error
Source§fn from(err: SdkError<StartMetricStreamsError, R>) -> Self
fn from(err: SdkError<StartMetricStreamsError, R>) -> Self
Source§impl<R> From<SdkError<StopMetricStreamsError, R>> for Error
impl<R> From<SdkError<StopMetricStreamsError, R>> for Error
Source§fn from(err: SdkError<StopMetricStreamsError, R>) -> Self
fn from(err: SdkError<StopMetricStreamsError, 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 From<SetAlarmStateError> for Error
impl From<SetAlarmStateError> for Error
Source§fn from(err: SetAlarmStateError) -> Self
fn from(err: SetAlarmStateError) -> Self
Source§impl From<StartMetricStreamsError> for Error
impl From<StartMetricStreamsError> for Error
Source§fn from(err: StartMetricStreamsError) -> Self
fn from(err: StartMetricStreamsError) -> Self
Source§impl From<StopMetricStreamsError> for Error
impl From<StopMetricStreamsError> for Error
Source§fn from(err: StopMetricStreamsError) -> Self
fn from(err: StopMetricStreamsError) -> 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<O, E> From<WaiterError<O, E>> for Error
impl<O, E> From<WaiterError<O, E>> for Error
Source§fn from(err: WaiterError<O, E>) -> Self
fn from(err: WaiterError<O, E>) -> 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);