Enum tvix_eval::CatchableErrorKind
source · pub enum CatchableErrorKind {
Throw(Box<str>),
AssertionFailed,
UnimplementedFeature(Box<str>),
NixPathResolution(Box<str>),
}
Expand description
“CatchableErrorKind” errors – those which can be detected by
builtins.tryEval
.
Note: this type is deliberately not incorporated as a variant of ErrorKind, because then Result<Value,ErrorKind> would have redundant representations for catchable errors, which would make it too easy to handle errors incorrectly:
- Ok(Value::Catchable(cek))
- Err(ErrorKind::ThisVariantDoesNotExist(cek))
Because CatchableErrorKind is not a variant of ErrorKind, you will often see functions which return a type like:
Result<Result<T,CatchableErrorKind>,ErrorKind>
… where T is any type other than Value. This is unfortunate,
because Rust’s magic ?
-syntax does not work on nested Result
values like this.
Variants§
Throw(Box<str>)
AssertionFailed
UnimplementedFeature(Box<str>)
NixPathResolution(Box<str>)
Resolving a user-supplied angle brackets path literal failed in some way.
Trait Implementations§
source§impl Clone for CatchableErrorKind
impl Clone for CatchableErrorKind
source§fn clone(&self) -> CatchableErrorKind
fn clone(&self) -> CatchableErrorKind
Returns a copy 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 CatchableErrorKind
impl Debug for CatchableErrorKind
source§impl Display for CatchableErrorKind
impl Display for CatchableErrorKind
source§impl Error for CatchableErrorKind
impl Error for CatchableErrorKind
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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<CatchableErrorKind> for Value
impl From<CatchableErrorKind> for Value
source§fn from(c: CatchableErrorKind) -> Value
fn from(c: CatchableErrorKind) -> Value
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CatchableErrorKind
impl RefUnwindSafe for CatchableErrorKind
impl Send for CatchableErrorKind
impl Sync for CatchableErrorKind
impl Unpin for CatchableErrorKind
impl UnwindSafe for CatchableErrorKind
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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