pub enum ResourceError {
Time {
limit: Duration,
elapsed: Duration,
},
Memory {
limit: usize,
used: usize,
},
Recursion {
limit: usize,
depth: usize,
},
}Expand description
Error returned when a resource limit is exceeded during execution.
This allows the sandbox to enforce strict limits on execution time and memory usage.
All variants except Recursion are uncatchable inside the sandbox:
untrusted code must never intercept resource enforcement. Recursion
surfaces as a catchable RecursionError, matching CPython.
Variants§
Time
Maximum execution time exceeded.
Memory
Maximum memory usage exceeded.
Recursion
Maximum recursion depth exceeded.
Trait Implementations§
Source§impl Clone for ResourceError
impl Clone for ResourceError
Source§fn clone(&self) -> ResourceError
fn clone(&self) -> ResourceError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ResourceError
impl Debug for ResourceError
Source§impl Display for ResourceError
impl Display for ResourceError
Source§impl Error for ResourceError
impl Error for ResourceError
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<ResourceError> for InvalidInputError
impl From<ResourceError> for InvalidInputError
Source§fn from(err: ResourceError) -> Self
fn from(err: ResourceError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ResourceError
impl RefUnwindSafe for ResourceError
impl Send for ResourceError
impl Sync for ResourceError
impl Unpin for ResourceError
impl UnsafeUnpin for ResourceError
impl UnwindSafe for ResourceError
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