#[non_exhaustive]pub enum Error {
Show 17 variants
AccessDeniedException(AccessDeniedException),
ExpiredIteratorException(ExpiredIteratorException),
ExpiredNextTokenException(ExpiredNextTokenException),
InternalFailureException(InternalFailureException),
InvalidArgumentException(InvalidArgumentException),
KmsAccessDeniedException(KmsAccessDeniedException),
KmsDisabledException(KmsDisabledException),
KmsInvalidStateException(KmsInvalidStateException),
KmsNotFoundException(KmsNotFoundException),
KmsOptInRequired(KmsOptInRequired),
KmsThrottlingException(KmsThrottlingException),
LimitExceededException(LimitExceededException),
ProvisionedThroughputExceededException(ProvisionedThroughputExceededException),
ResourceInUseException(ResourceInUseException),
ResourceNotFoundException(ResourceNotFoundException),
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)
Specifies that you do not have the permissions required to perform this operation.
ExpiredIteratorException(ExpiredIteratorException)
The provided iterator exceeds the maximum age allowed.
ExpiredNextTokenException(ExpiredNextTokenException)
The pagination token passed to the operation is expired.
InternalFailureException(InternalFailureException)
The processing of the request failed because of an unknown error, exception, or failure.
InvalidArgumentException(InvalidArgumentException)
A specified parameter exceeds its restrictions, is not supported, or can't be used. For more information, see the returned message.
KmsAccessDeniedException(KmsAccessDeniedException)
The ciphertext references a key that doesn't exist or that you don't have access to.
KmsDisabledException(KmsDisabledException)
The request was rejected because the specified customer master key (CMK) isn't enabled.
KmsInvalidStateException(KmsInvalidStateException)
The request was rejected because the state of the specified resource isn't valid for this request. For more information, see How Key State Affects Use of a Customer Master Key in the Amazon Web Services Key Management Service Developer Guide.
KmsNotFoundException(KmsNotFoundException)
The request was rejected because the specified entity or resource can't be found.
KmsOptInRequired(KmsOptInRequired)
The Amazon Web Services access key ID needs a subscription for the service.
KmsThrottlingException(KmsThrottlingException)
The request was denied due to request throttling. For more information about throttling, see Limits in the Amazon Web Services Key Management Service Developer Guide.
LimitExceededException(LimitExceededException)
The requested resource exceeds the maximum number allowed, or the number of concurrent stream requests exceeds the maximum number allowed.
ProvisionedThroughputExceededException(ProvisionedThroughputExceededException)
The request rate for the stream is too high, or the requested data is too large for the available throughput. Reduce the frequency or size of your requests. For more information, see Streams Limits in the Amazon Kinesis Data Streams Developer Guide, and Error Retries and Exponential Backoff in Amazon Web Services in the Amazon Web Services General Reference.
ResourceInUseException(ResourceInUseException)
The resource is not available for this operation. For successful operation, the resource must be in the ACTIVE
state.
ResourceNotFoundException(ResourceNotFoundException)
The requested resource could not be found. The stream might not be specified correctly.
ValidationException(ValidationException)
Specifies that you tried to invoke this API for a data stream with the on-demand capacity mode. This API is only supported for data streams with the provisioned capacity mode.
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<AddTagsToStreamError> for Error
impl From<AddTagsToStreamError> for Error
Source§fn from(err: AddTagsToStreamError) -> Self
fn from(err: AddTagsToStreamError) -> 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<CreateStreamError> for Error
impl From<CreateStreamError> for Error
Source§fn from(err: CreateStreamError) -> Self
fn from(err: CreateStreamError) -> Self
Source§impl From<DecreaseStreamRetentionPeriodError> for Error
impl From<DecreaseStreamRetentionPeriodError> for Error
Source§fn from(err: DecreaseStreamRetentionPeriodError) -> Self
fn from(err: DecreaseStreamRetentionPeriodError) -> Self
Source§impl From<DeleteResourcePolicyError> for Error
impl From<DeleteResourcePolicyError> for Error
Source§fn from(err: DeleteResourcePolicyError) -> Self
fn from(err: DeleteResourcePolicyError) -> Self
Source§impl From<DeleteStreamError> for Error
impl From<DeleteStreamError> for Error
Source§fn from(err: DeleteStreamError) -> Self
fn from(err: DeleteStreamError) -> Self
Source§impl From<DeregisterStreamConsumerError> for Error
impl From<DeregisterStreamConsumerError> for Error
Source§fn from(err: DeregisterStreamConsumerError) -> Self
fn from(err: DeregisterStreamConsumerError) -> Self
Source§impl From<DescribeLimitsError> for Error
impl From<DescribeLimitsError> for Error
Source§fn from(err: DescribeLimitsError) -> Self
fn from(err: DescribeLimitsError) -> Self
Source§impl From<DescribeStreamConsumerError> for Error
impl From<DescribeStreamConsumerError> for Error
Source§fn from(err: DescribeStreamConsumerError) -> Self
fn from(err: DescribeStreamConsumerError) -> Self
Source§impl From<DescribeStreamError> for Error
impl From<DescribeStreamError> for Error
Source§fn from(err: DescribeStreamError) -> Self
fn from(err: DescribeStreamError) -> Self
Source§impl From<DescribeStreamSummaryError> for Error
impl From<DescribeStreamSummaryError> for Error
Source§fn from(err: DescribeStreamSummaryError) -> Self
fn from(err: DescribeStreamSummaryError) -> Self
Source§impl From<DisableEnhancedMonitoringError> for Error
impl From<DisableEnhancedMonitoringError> for Error
Source§fn from(err: DisableEnhancedMonitoringError) -> Self
fn from(err: DisableEnhancedMonitoringError) -> Self
Source§impl From<EnableEnhancedMonitoringError> for Error
impl From<EnableEnhancedMonitoringError> for Error
Source§fn from(err: EnableEnhancedMonitoringError) -> Self
fn from(err: EnableEnhancedMonitoringError) -> Self
Source§impl From<GetRecordsError> for Error
impl From<GetRecordsError> for Error
Source§fn from(err: GetRecordsError) -> Self
fn from(err: GetRecordsError) -> Self
Source§impl From<GetResourcePolicyError> for Error
impl From<GetResourcePolicyError> for Error
Source§fn from(err: GetResourcePolicyError) -> Self
fn from(err: GetResourcePolicyError) -> Self
Source§impl From<GetShardIteratorError> for Error
impl From<GetShardIteratorError> for Error
Source§fn from(err: GetShardIteratorError) -> Self
fn from(err: GetShardIteratorError) -> Self
Source§impl From<IncreaseStreamRetentionPeriodError> for Error
impl From<IncreaseStreamRetentionPeriodError> for Error
Source§fn from(err: IncreaseStreamRetentionPeriodError) -> Self
fn from(err: IncreaseStreamRetentionPeriodError) -> Self
Source§impl From<ListShardsError> for Error
impl From<ListShardsError> for Error
Source§fn from(err: ListShardsError) -> Self
fn from(err: ListShardsError) -> Self
Source§impl From<ListStreamConsumersError> for Error
impl From<ListStreamConsumersError> for Error
Source§fn from(err: ListStreamConsumersError) -> Self
fn from(err: ListStreamConsumersError) -> Self
Source§impl From<ListStreamsError> for Error
impl From<ListStreamsError> for Error
Source§fn from(err: ListStreamsError) -> Self
fn from(err: ListStreamsError) -> 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<ListTagsForStreamError> for Error
impl From<ListTagsForStreamError> for Error
Source§fn from(err: ListTagsForStreamError) -> Self
fn from(err: ListTagsForStreamError) -> Self
Source§impl From<MergeShardsError> for Error
impl From<MergeShardsError> for Error
Source§fn from(err: MergeShardsError) -> Self
fn from(err: MergeShardsError) -> Self
Source§impl From<PutRecordError> for Error
impl From<PutRecordError> for Error
Source§fn from(err: PutRecordError) -> Self
fn from(err: PutRecordError) -> Self
Source§impl From<PutRecordsError> for Error
impl From<PutRecordsError> for Error
Source§fn from(err: PutRecordsError) -> Self
fn from(err: PutRecordsError) -> Self
Source§impl From<PutResourcePolicyError> for Error
impl From<PutResourcePolicyError> for Error
Source§fn from(err: PutResourcePolicyError) -> Self
fn from(err: PutResourcePolicyError) -> Self
Source§impl From<RegisterStreamConsumerError> for Error
impl From<RegisterStreamConsumerError> for Error
Source§fn from(err: RegisterStreamConsumerError) -> Self
fn from(err: RegisterStreamConsumerError) -> Self
Source§impl From<RemoveTagsFromStreamError> for Error
impl From<RemoveTagsFromStreamError> for Error
Source§fn from(err: RemoveTagsFromStreamError) -> Self
fn from(err: RemoveTagsFromStreamError) -> Self
Source§impl<R> From<SdkError<AddTagsToStreamError, R>> for Error
impl<R> From<SdkError<AddTagsToStreamError, R>> for Error
Source§fn from(err: SdkError<AddTagsToStreamError, R>) -> Self
fn from(err: SdkError<AddTagsToStreamError, R>) -> Self
Source§impl<R> From<SdkError<CreateStreamError, R>> for Error
impl<R> From<SdkError<CreateStreamError, R>> for Error
Source§fn from(err: SdkError<CreateStreamError, R>) -> Self
fn from(err: SdkError<CreateStreamError, R>) -> Self
Source§impl<R> From<SdkError<DecreaseStreamRetentionPeriodError, R>> for Error
impl<R> From<SdkError<DecreaseStreamRetentionPeriodError, R>> for Error
Source§fn from(err: SdkError<DecreaseStreamRetentionPeriodError, R>) -> Self
fn from(err: SdkError<DecreaseStreamRetentionPeriodError, R>) -> Self
Source§impl<R> From<SdkError<DeleteResourcePolicyError, R>> for Error
impl<R> From<SdkError<DeleteResourcePolicyError, R>> for Error
Source§fn from(err: SdkError<DeleteResourcePolicyError, R>) -> Self
fn from(err: SdkError<DeleteResourcePolicyError, R>) -> Self
Source§impl<R> From<SdkError<DeleteStreamError, R>> for Error
impl<R> From<SdkError<DeleteStreamError, R>> for Error
Source§fn from(err: SdkError<DeleteStreamError, R>) -> Self
fn from(err: SdkError<DeleteStreamError, R>) -> Self
Source§impl<R> From<SdkError<DeregisterStreamConsumerError, R>> for Error
impl<R> From<SdkError<DeregisterStreamConsumerError, R>> for Error
Source§fn from(err: SdkError<DeregisterStreamConsumerError, R>) -> Self
fn from(err: SdkError<DeregisterStreamConsumerError, R>) -> Self
Source§impl<R> From<SdkError<DescribeLimitsError, R>> for Error
impl<R> From<SdkError<DescribeLimitsError, R>> for Error
Source§fn from(err: SdkError<DescribeLimitsError, R>) -> Self
fn from(err: SdkError<DescribeLimitsError, R>) -> Self
Source§impl<R> From<SdkError<DescribeStreamConsumerError, R>> for Error
impl<R> From<SdkError<DescribeStreamConsumerError, R>> for Error
Source§fn from(err: SdkError<DescribeStreamConsumerError, R>) -> Self
fn from(err: SdkError<DescribeStreamConsumerError, R>) -> Self
Source§impl<R> From<SdkError<DescribeStreamError, R>> for Error
impl<R> From<SdkError<DescribeStreamError, R>> for Error
Source§fn from(err: SdkError<DescribeStreamError, R>) -> Self
fn from(err: SdkError<DescribeStreamError, R>) -> Self
Source§impl<R> From<SdkError<DescribeStreamSummaryError, R>> for Error
impl<R> From<SdkError<DescribeStreamSummaryError, R>> for Error
Source§fn from(err: SdkError<DescribeStreamSummaryError, R>) -> Self
fn from(err: SdkError<DescribeStreamSummaryError, R>) -> Self
Source§impl<R> From<SdkError<DisableEnhancedMonitoringError, R>> for Error
impl<R> From<SdkError<DisableEnhancedMonitoringError, R>> for Error
Source§fn from(err: SdkError<DisableEnhancedMonitoringError, R>) -> Self
fn from(err: SdkError<DisableEnhancedMonitoringError, R>) -> Self
Source§impl<R> From<SdkError<EnableEnhancedMonitoringError, R>> for Error
impl<R> From<SdkError<EnableEnhancedMonitoringError, R>> for Error
Source§fn from(err: SdkError<EnableEnhancedMonitoringError, R>) -> Self
fn from(err: SdkError<EnableEnhancedMonitoringError, R>) -> Self
Source§impl<R> From<SdkError<GetRecordsError, R>> for Error
impl<R> From<SdkError<GetRecordsError, R>> for Error
Source§fn from(err: SdkError<GetRecordsError, R>) -> Self
fn from(err: SdkError<GetRecordsError, R>) -> Self
Source§impl<R> From<SdkError<GetResourcePolicyError, R>> for Error
impl<R> From<SdkError<GetResourcePolicyError, R>> for Error
Source§fn from(err: SdkError<GetResourcePolicyError, R>) -> Self
fn from(err: SdkError<GetResourcePolicyError, R>) -> Self
Source§impl<R> From<SdkError<GetShardIteratorError, R>> for Error
impl<R> From<SdkError<GetShardIteratorError, R>> for Error
Source§fn from(err: SdkError<GetShardIteratorError, R>) -> Self
fn from(err: SdkError<GetShardIteratorError, R>) -> Self
Source§impl<R> From<SdkError<IncreaseStreamRetentionPeriodError, R>> for Error
impl<R> From<SdkError<IncreaseStreamRetentionPeriodError, R>> for Error
Source§fn from(err: SdkError<IncreaseStreamRetentionPeriodError, R>) -> Self
fn from(err: SdkError<IncreaseStreamRetentionPeriodError, R>) -> Self
Source§impl<R> From<SdkError<ListShardsError, R>> for Error
impl<R> From<SdkError<ListShardsError, R>> for Error
Source§fn from(err: SdkError<ListShardsError, R>) -> Self
fn from(err: SdkError<ListShardsError, R>) -> Self
Source§impl<R> From<SdkError<ListStreamConsumersError, R>> for Error
impl<R> From<SdkError<ListStreamConsumersError, R>> for Error
Source§fn from(err: SdkError<ListStreamConsumersError, R>) -> Self
fn from(err: SdkError<ListStreamConsumersError, R>) -> Self
Source§impl<R> From<SdkError<ListStreamsError, R>> for Error
impl<R> From<SdkError<ListStreamsError, R>> for Error
Source§fn from(err: SdkError<ListStreamsError, R>) -> Self
fn from(err: SdkError<ListStreamsError, 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<ListTagsForStreamError, R>> for Error
impl<R> From<SdkError<ListTagsForStreamError, R>> for Error
Source§fn from(err: SdkError<ListTagsForStreamError, R>) -> Self
fn from(err: SdkError<ListTagsForStreamError, R>) -> Self
Source§impl<R> From<SdkError<MergeShardsError, R>> for Error
impl<R> From<SdkError<MergeShardsError, R>> for Error
Source§fn from(err: SdkError<MergeShardsError, R>) -> Self
fn from(err: SdkError<MergeShardsError, R>) -> Self
Source§impl<R> From<SdkError<PutRecordError, R>> for Error
impl<R> From<SdkError<PutRecordError, R>> for Error
Source§fn from(err: SdkError<PutRecordError, R>) -> Self
fn from(err: SdkError<PutRecordError, R>) -> Self
Source§impl<R> From<SdkError<PutRecordsError, R>> for Error
impl<R> From<SdkError<PutRecordsError, R>> for Error
Source§fn from(err: SdkError<PutRecordsError, R>) -> Self
fn from(err: SdkError<PutRecordsError, R>) -> Self
Source§impl<R> From<SdkError<PutResourcePolicyError, R>> for Error
impl<R> From<SdkError<PutResourcePolicyError, R>> for Error
Source§fn from(err: SdkError<PutResourcePolicyError, R>) -> Self
fn from(err: SdkError<PutResourcePolicyError, R>) -> Self
Source§impl<R> From<SdkError<RegisterStreamConsumerError, R>> for Error
impl<R> From<SdkError<RegisterStreamConsumerError, R>> for Error
Source§fn from(err: SdkError<RegisterStreamConsumerError, R>) -> Self
fn from(err: SdkError<RegisterStreamConsumerError, R>) -> Self
Source§impl<R> From<SdkError<RemoveTagsFromStreamError, R>> for Error
impl<R> From<SdkError<RemoveTagsFromStreamError, R>> for Error
Source§fn from(err: SdkError<RemoveTagsFromStreamError, R>) -> Self
fn from(err: SdkError<RemoveTagsFromStreamError, R>) -> Self
Source§impl<R> From<SdkError<SplitShardError, R>> for Error
impl<R> From<SdkError<SplitShardError, R>> for Error
Source§fn from(err: SdkError<SplitShardError, R>) -> Self
fn from(err: SdkError<SplitShardError, R>) -> Self
Source§impl<R> From<SdkError<StartStreamEncryptionError, R>> for Error
impl<R> From<SdkError<StartStreamEncryptionError, R>> for Error
Source§fn from(err: SdkError<StartStreamEncryptionError, R>) -> Self
fn from(err: SdkError<StartStreamEncryptionError, R>) -> Self
Source§impl<R> From<SdkError<StopStreamEncryptionError, R>> for Error
impl<R> From<SdkError<StopStreamEncryptionError, R>> for Error
Source§fn from(err: SdkError<StopStreamEncryptionError, R>) -> Self
fn from(err: SdkError<StopStreamEncryptionError, R>) -> Self
Source§impl<R> From<SdkError<SubscribeToShardError, R>> for Error
impl<R> From<SdkError<SubscribeToShardError, R>> for Error
Source§fn from(err: SdkError<SubscribeToShardError, R>) -> Self
fn from(err: SdkError<SubscribeToShardError, R>) -> Self
Source§impl<R> From<SdkError<SubscribeToShardEventStreamError, R>> for Error
impl<R> From<SdkError<SubscribeToShardEventStreamError, R>> for Error
Source§fn from(err: SdkError<SubscribeToShardEventStreamError, R>) -> Self
fn from(err: SdkError<SubscribeToShardEventStreamError, R>) -> Self
Source§impl<R> From<SdkError<TagResourceError, R>> for Error
impl<R> From<SdkError<TagResourceError, R>> for Error
Source§fn from(err: SdkError<TagResourceError, R>) -> Self
fn from(err: SdkError<TagResourceError, R>) -> Self
Source§impl<R> From<SdkError<UntagResourceError, R>> for Error
impl<R> From<SdkError<UntagResourceError, R>> for Error
Source§fn from(err: SdkError<UntagResourceError, R>) -> Self
fn from(err: SdkError<UntagResourceError, R>) -> Self
Source§impl<R> From<SdkError<UpdateShardCountError, R>> for Error
impl<R> From<SdkError<UpdateShardCountError, R>> for Error
Source§fn from(err: SdkError<UpdateShardCountError, R>) -> Self
fn from(err: SdkError<UpdateShardCountError, R>) -> Self
Source§impl<R> From<SdkError<UpdateStreamModeError, R>> for Error
impl<R> From<SdkError<UpdateStreamModeError, R>> for Error
Source§fn from(err: SdkError<UpdateStreamModeError, R>) -> Self
fn from(err: SdkError<UpdateStreamModeError, R>) -> Self
Source§impl From<SplitShardError> for Error
impl From<SplitShardError> for Error
Source§fn from(err: SplitShardError) -> Self
fn from(err: SplitShardError) -> Self
Source§impl From<StartStreamEncryptionError> for Error
impl From<StartStreamEncryptionError> for Error
Source§fn from(err: StartStreamEncryptionError) -> Self
fn from(err: StartStreamEncryptionError) -> Self
Source§impl From<StopStreamEncryptionError> for Error
impl From<StopStreamEncryptionError> for Error
Source§fn from(err: StopStreamEncryptionError) -> Self
fn from(err: StopStreamEncryptionError) -> Self
Source§impl From<SubscribeToShardError> for Error
impl From<SubscribeToShardError> for Error
Source§fn from(err: SubscribeToShardError) -> Self
fn from(err: SubscribeToShardError) -> Self
Source§impl From<SubscribeToShardEventStreamError> for Error
impl From<SubscribeToShardEventStreamError> for Error
Source§fn from(err: SubscribeToShardEventStreamError) -> Self
fn from(err: SubscribeToShardEventStreamError) -> Self
Source§impl From<TagResourceError> for Error
impl From<TagResourceError> for Error
Source§fn from(err: TagResourceError) -> Self
fn from(err: TagResourceError) -> Self
Source§impl From<UntagResourceError> for Error
impl From<UntagResourceError> for Error
Source§fn from(err: UntagResourceError) -> Self
fn from(err: UntagResourceError) -> Self
Source§impl From<UpdateShardCountError> for Error
impl From<UpdateShardCountError> for Error
Source§fn from(err: UpdateShardCountError) -> Self
fn from(err: UpdateShardCountError) -> Self
Source§impl From<UpdateStreamModeError> for Error
impl From<UpdateStreamModeError> for Error
Source§fn from(err: UpdateStreamModeError) -> Self
fn from(err: UpdateStreamModeError) -> 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);