#[non_exhaustive]pub enum SimError {
Io(Error),
Bind {
addr: String,
source: Error,
},
Api(ApiError),
}Expand description
The error type returned by the simulator crate’s public library API.
Distinct from ApiError (which is the per-request HTTP error type that
implements IntoResponse). SimError is what run, run_with_listener,
and prepare_state return; it composes the underlying typed variants
(I/O, bind failures, ApiError) so callers can pattern-match if they
need to and so the reposix-sim binary can adapt to anyhow::Error for
free via the blanket From<E: std::error::Error + Send + Sync + 'static>
impl on anyhow::Error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
Generic I/O failure — covers axum::serve (which returns io::Error),
TcpListener::local_addr, and any unspecified I/O during startup.
Bind
Failed to bind the configured listener address.
Fields
Api(ApiError)
An ApiError surfaced from internal helpers (db::open_db,
seed::load_seed). Wrapped instead of flattened so future
pattern-matching can recover the original variant.
Trait Implementations§
Source§impl Error for SimError
impl Error for SimError
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 Freeze for SimError
impl !RefUnwindSafe for SimError
impl Send for SimError
impl Sync for SimError
impl Unpin for SimError
impl UnsafeUnpin for SimError
impl !UnwindSafe for SimError
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> 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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.