pub enum ResolveError {
PathTraversal {
name: String,
},
AssetParse {
source: Box<dyn Error + Send + Sync>,
},
Io {
path: PathBuf,
source: Error,
},
}Expand description
Error type for module resolution.
Structurally represents domain-specific errors that occur during resolve().
Converted to a Lua error via mlua::Error::external() and can be
recovered on the caller side with err.downcast_ref::<ResolveError>().
Construction-time errors (e.g. root directory not found) are returned as
sandbox::InitError and are not included here.
Variants§
PathTraversal
Path access outside the sandbox detected.
Raised both by genuine escape attempts and by a legitimate symlink
whose target lies outside the root. For the latter, build the
resolver with resolvers::FsResolver::new_symlink_aware so the
symlink targets become part of the allowed set.
AssetParse
Asset parse failure.
Generalized to hold different error types per parser.
resolvers::json_parser() stores serde_json::Error;
custom parsers can store any error type.
Io
File I/O error.
Raised when a file exists but cannot be read (e.g. permission denied, is a directory).
Trait Implementations§
Source§impl Debug for ResolveError
impl Debug for ResolveError
Source§impl Display for ResolveError
impl Display for ResolveError
Source§impl Error for ResolveError
impl Error for ResolveError
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
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for ResolveError
impl !UnwindSafe for ResolveError
impl Freeze for ResolveError
impl Send for ResolveError
impl Sync for ResolveError
impl Unpin for ResolveError
impl UnsafeUnpin for ResolveError
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<E> ExternalError for E
impl<E> ExternalError for E
fn into_lua_err(self) -> Error
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 more