pub struct BeatError {
pub errno: i32,
pub kind: ErrorKind,
}Expand description
Payload of BeatOutcome::Failed.
Copy by construction: allocating a BeatError is structurally
impossible, so the Varta::beat slow path is allocation-free
regardless of how the underlying io::Error was represented.
Callers wanting a full io::Error can call Self::to_io_error.
Fields§
§errno: i32Raw OS errno when the failure came from a syscall;
BeatError::UNKNOWN_ERRNO (0) when not OS-derived.
POSIX guarantees errno is never 0 on a real syscall failure.
kind: ErrorKindThe libstd io::ErrorKind classification. Always populated.
Implementations§
Source§impl BeatError
impl BeatError
Sourcepub const UNKNOWN_ERRNO: i32 = 0
pub const UNKNOWN_ERRNO: i32 = 0
Sentinel value used when no OS error number is available.
Sourcepub fn from_io(e: &Error) -> Self
pub fn from_io(e: &Error) -> Self
Capture the failure shape from an io::Error without cloning or allocating.
Sourcepub fn to_io_error(self) -> Error
pub fn to_io_error(self) -> Error
Reconstruct an io::Error. Allocation-free when errno != 0 (uses
Repr::Os); falls back to Repr::Simple(kind) otherwise.
Trait Implementations§
Source§impl Error for BeatError
impl Error for BeatError
1.30.0 · 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()