pub enum SandboxError {
Show 31 variants
SecurityViolation {
violation: String,
instance_id: Option<InstanceId>,
context: SecurityContext,
},
ResourceExhausted {
kind: ResourceKind,
limit: u64,
used: u64,
instance_id: Option<InstanceId>,
suggestion: Option<String>,
},
WasmRuntime {
function: String,
instance_id: Option<InstanceId>,
message: String,
},
Configuration {
message: String,
suggestion: Option<String>,
field: Option<String>,
},
Module {
operation: String,
reason: String,
suggestion: Option<String>,
},
Instance {
operation: String,
instance_id: Option<InstanceId>,
reason: String,
},
Communication {
channel: String,
reason: String,
instance_id: Option<InstanceId>,
},
Timeout {
operation: String,
duration: Duration,
instance_id: Option<InstanceId>,
},
FunctionCall {
function_name: String,
reason: String,
},
Filesystem {
operation: String,
path: PathBuf,
reason: String,
},
Network {
operation: String,
reason: String,
endpoint: Option<String>,
},
Serialization {
format: String,
operation: String,
reason: String,
},
InvalidInput {
field: String,
reason: String,
suggestion: Option<String>,
},
NotFound {
resource_type: String,
identifier: String,
},
Unsupported {
operation: String,
context: String,
suggestion: Option<String>,
},
Generic {
message: String,
},
Template {
message: String,
},
Compilation {
message: String,
},
InstanceCreation {
reason: String,
instance_id: Option<InstanceId>,
},
WrapperGeneration {
reason: String,
wrapper_type: Option<String>,
},
ModuleLoad {
message: String,
},
RuntimeInitialization {
message: String,
},
IoError {
message: String,
},
Capability {
message: String,
},
ResourceLimit {
message: String,
},
UnsupportedOperation {
message: String,
},
Io(Error),
Json(Error),
MessagePack(Error),
MessagePackDecode(Error),
Other(Error),
}
Expand description
Enhanced error types for the wasm-sandbox crate with detailed context
Variants§
SecurityViolation
Security violation with detailed context
ResourceExhausted
Resource exhausted with specific usage details
WasmRuntime
WASM runtime error with function context
Configuration
Configuration error with helpful suggestions
Module
Module compilation or loading error
Instance
Instance management error
Communication
Communication channel error
Timeout
Timeout error with context
FunctionCall
Function call error
Filesystem
File system error with path context
Network
Network error with context
Serialization
Serialization/deserialization error
InvalidInput
Invalid input with validation details
NotFound
Resource not found
Unsupported
Operation not supported
Generic
Generic error with a message
Template
Template rendering error
Compilation
Compilation error
InstanceCreation
Instance creation error
WrapperGeneration
Wrapper generation error
ModuleLoad
Module load error
RuntimeInitialization
Runtime initialization error
IoError
IO error with context
Capability
Capability error
ResourceLimit
Resource limit error
UnsupportedOperation
Unsupported operation error
Io(Error)
Json(Error)
MessagePack(Error)
MessagePackDecode(Error)
Other(Error)
Implementations§
Source§impl SandboxError
impl SandboxError
Sourcepub fn security_violation(
violation: impl Into<String>,
context: SecurityContext,
) -> Self
pub fn security_violation( violation: impl Into<String>, context: SecurityContext, ) -> Self
Create a security violation error
Sourcepub fn resource_exhausted(
kind: ResourceKind,
used: u64,
limit: u64,
suggestion: Option<String>,
) -> Self
pub fn resource_exhausted( kind: ResourceKind, used: u64, limit: u64, suggestion: Option<String>, ) -> Self
Create a resource exhausted error
Sourcepub fn config_error(
message: impl Into<String>,
suggestion: Option<String>,
) -> Self
pub fn config_error( message: impl Into<String>, suggestion: Option<String>, ) -> Self
Create a configuration error with suggestion
Sourcepub fn module_load_error(reason: impl Into<String>) -> Self
pub fn module_load_error(reason: impl Into<String>) -> Self
Create a module loading error
Trait Implementations§
Source§impl Clone for SandboxError
impl Clone for SandboxError
Source§impl Debug for SandboxError
impl Debug for SandboxError
Source§impl Display for SandboxError
impl Display for SandboxError
Source§impl Error for SandboxError
impl Error for SandboxError
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
Source§impl From<Error> for SandboxError
impl From<Error> for SandboxError
Source§impl From<Error> for SandboxError
impl From<Error> for SandboxError
Source§impl From<Error> for SandboxError
impl From<Error> for SandboxError
Source§impl From<Error> for SandboxError
impl From<Error> for SandboxError
Auto Trait Implementations§
impl Freeze for SandboxError
impl !RefUnwindSafe for SandboxError
impl Send for SandboxError
impl Sync for SandboxError
impl Unpin for SandboxError
impl !UnwindSafe for SandboxError
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self
file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
self
file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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