#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
#[non_exhaustive]
pub enum CastError {
#[error("unsupported cast `{0}`")]
Unsupported(String),
#[error("cast `{cast}`: {reason}")]
Invalid {
cast: String,
reason: String,
},
#[error(transparent)]
Pattern(#[from] php_dates::Error),
#[error(
"cast `{0}` hashes on the blocking pool: use `set_async`, `apply_async` or `cast_array_async`"
)]
NeedsAsync(String),
#[error("cast `{cast}`: {message}")]
Failed {
cast: String,
message: String,
},
#[error("{0}")]
Rejected(String),
}