pub enum Error {
Lua(Error),
Config(String),
Script(String),
Io(Error),
Http(Error),
Timeout,
PoolBusy,
Panic(String),
ShutdownTimeout,
}Expand description
Errors returned by the Nitr library.
Variants§
Lua(Error)
An error raised by the Lua runtime or a script.
Config(String)
An invalid or missing configuration value.
Script(String)
A script file could not be loaded or evaluated.
Io(Error)
An I/O error.
Http(Error)
An HTTP protocol error.
Timeout
The handler exceeded its execution budget.
PoolBusy
No Lua state became available within the pool wait budget; the request is shed rather than queued indefinitely.
Panic(String)
A panic was caught while running a request. The state that was in use is recycled; this is always a bug in Rust code (Nitr’s or an extension module’s), never in a Lua script.
ShutdownTimeout
The graceful-shutdown drain deadline expired with connections still in flight, so they were aborted. Surfaced rather than swallowed: a truncated shutdown means a client’s request was cut.
Implementations§
Source§impl Error
impl Error
Sourcepub fn poisons_state(&self) -> bool
pub fn poisons_state(&self) -> bool
Whether this error leaves the Lua state unfit for reuse.
A memory-limit hit is the clear case: the allocator refused, the state’s heap sits at its ceiling, and the next request would inherit the problem. Ordinary script errors are not damage — Lua unwinds cleanly and the state is fine.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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 Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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> 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