crossio_core/
error.rs

1//! Error types surfaced by the crossio core crate.
2use std::io;
3
4/// Unified error returned by core APIs regardless of backend.
5#[derive(Debug, thiserror::Error)]
6pub enum CrossioError {
7    /// Configuration supplied to the backend was invalid.
8    #[error("invalid backend configuration: {0}")]
9    InvalidConfig(&'static str),
10
11    /// The backend failed to initialize because the platform feature is unavailable.
12    #[error("backend unavailable: {0}")]
13    BackendUnavailable(&'static str),
14
15    /// The backend could not register more sources because it reached a limit.
16    #[error("resource limit reached")]
17    ResourceLimit,
18
19    /// Wrapper around [`std::io::Error`] so syscall failures can bubble up directly.
20    #[error(transparent)]
21    Io(#[from] io::Error),
22}