#[non_exhaustive]pub struct VacantError {
pub param: Param,
pub vacancy: Vacancy,
pub message: Option<String>,
}Expand description
Error caused by a Switch of SwitchAction::Error
VacantError is an error that is returned when you apply an error switch to
a vacant value.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.param: ParamParameter that caused this error
vacancy: VacancyState of the parameter value that caused this error
message: Option<String>Error message specified in the switch
Implementations§
Source§impl VacantError
impl VacantError
Sourcepub fn message_or_default(&self) -> &str
pub fn message_or_default(&self) -> &str
Returns the message.
If self.message is Some(_), its content is returned. Otherwise, the
default message is returned.
Trait Implementations§
Source§impl Clone for VacantError
impl Clone for VacantError
Source§fn clone(&self) -> VacantError
fn clone(&self) -> VacantError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VacantError
impl Debug for VacantError
Source§impl Display for VacantError
impl Display for VacantError
Source§impl Error for VacantError
impl Error for VacantError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<VacantError> for ErrorCause
impl From<VacantError> for ErrorCause
Source§fn from(source: VacantError) -> Self
fn from(source: VacantError) -> Self
Converts to this type from the input type.
Source§impl Hash for VacantError
impl Hash for VacantError
Source§impl PartialEq for VacantError
impl PartialEq for VacantError
impl Eq for VacantError
impl StructuralPartialEq for VacantError
Auto Trait Implementations§
impl Freeze for VacantError
impl RefUnwindSafe for VacantError
impl Send for VacantError
impl Sync for VacantError
impl Unpin for VacantError
impl UnwindSafe for VacantError
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 more