time::error

Enum Error

Source
#[non_exhaustive]
pub enum Error { ConversionRange(ConversionRange), ComponentRange(ComponentRange), Format(Format), ParseFromDescription(ParseFromDescription), UnexpectedTrailingCharacters, TryFromParsed(TryFromParsed), InvalidFormatDescription(InvalidFormatDescription), DifferentVariant(DifferentVariant), InvalidVariant(InvalidVariant), }
Expand description

A unified error type for anything returned by a method in the time crate.

This can be used when you either don’t know or don’t care about the exact error returned. Result<_, time::Error> (or its alias time::Result<_>) will work in these situations.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

ConversionRange(ConversionRange)

§

ComponentRange(ComponentRange)

§

Format(Format)

Available on crate feature formatting only.
§

ParseFromDescription(ParseFromDescription)

Available on crate feature parsing only.
§

UnexpectedTrailingCharacters

👎Deprecated since 0.3.28: no longer output. moved to the ParseFromDescription variant
Available on crate feature parsing only.
§

TryFromParsed(TryFromParsed)

Available on crate feature parsing only.
§

InvalidFormatDescription(InvalidFormatDescription)

Available on (crate features formatting or parsing) and crate feature alloc only.
§

DifferentVariant(DifferentVariant)

§

InvalidVariant(InvalidVariant)

Trait Implementations§

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Available on crate feature std only.
Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<ComponentRange> for Error

Source§

fn from(original: ComponentRange) -> Self

Converts to this type from the input type.
Source§

impl From<ConversionRange> for Error

Source§

fn from(err: ConversionRange) -> Self

Converts to this type from the input type.
Source§

impl From<DifferentVariant> for Error

Source§

fn from(err: DifferentVariant) -> Self

Converts to this type from the input type.
Source§

impl From<Format> for Error

Available on crate feature formatting only.
Source§

fn from(original: Format) -> Self

Converts to this type from the input type.
Source§

impl From<InvalidFormatDescription> for Error

Available on (crate features formatting or parsing) and crate feature alloc only.
Source§

fn from(original: InvalidFormatDescription) -> Self

Converts to this type from the input type.
Source§

impl From<InvalidVariant> for Error

Source§

fn from(err: InvalidVariant) -> Self

Converts to this type from the input type.
Source§

impl From<Parse> for Error

Available on crate feature parsing only.
Source§

fn from(err: Parse) -> Self

Converts to this type from the input type.
Source§

impl From<ParseFromDescription> for Error

Available on crate feature parsing only.
Source§

fn from(original: ParseFromDescription) -> Self

Converts to this type from the input type.
Source§

impl From<TryFromParsed> for Error

Available on crate feature parsing only.
Source§

fn from(original: TryFromParsed) -> Self

Converts to this type from the input type.
Source§

impl TryFrom<Error> for ComponentRange

Source§

type Error = DifferentVariant

The type returned in the event of a conversion error.
Source§

fn try_from(err: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for ConversionRange

Source§

type Error = DifferentVariant

The type returned in the event of a conversion error.
Source§

fn try_from(err: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for DifferentVariant

Source§

type Error = DifferentVariant

The type returned in the event of a conversion error.
Source§

fn try_from(err: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for Format

Available on crate feature formatting only.
Source§

type Error = DifferentVariant

The type returned in the event of a conversion error.
Source§

fn try_from(err: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for InvalidFormatDescription

Available on (crate features formatting or parsing) and crate feature alloc only.
Source§

type Error = DifferentVariant

The type returned in the event of a conversion error.
Source§

fn try_from(err: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for InvalidVariant

Source§

type Error = DifferentVariant

The type returned in the event of a conversion error.
Source§

fn try_from(err: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for Parse

Available on crate feature parsing only.
Source§

type Error = DifferentVariant

The type returned in the event of a conversion error.
Source§

fn try_from(err: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for ParseFromDescription

Available on crate feature parsing only.
Source§

type Error = DifferentVariant

The type returned in the event of a conversion error.
Source§

fn try_from(err: Error) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Error> for TryFromParsed

Available on crate feature parsing only.
Source§

type Error = DifferentVariant

The type returned in the event of a conversion error.
Source§

fn try_from(err: Error) -> Result<Self, Self::Error>

Performs the conversion.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 56 bytes

Size for each variant:

  • ConversionRange: 0 bytes
  • ComponentRange: 48 bytes
  • Format: 24 bytes
  • ParseFromDescription: 24 bytes
  • UnexpectedTrailingCharacters: 0 bytes
  • TryFromParsed: 48 bytes
  • InvalidFormatDescription: 48 bytes
  • DifferentVariant: 0 bytes
  • InvalidVariant: 0 bytes