//! The `Errno` type, which is a minimal wrapper around an error code. //! //! We define the error constants as individual `const`s instead of an enum //! because we may not know about all of the host's error values and we don't //! want unrecognized values to create undefined behavior.
usecrate::backend; use core::{fmt, result}; #[cfg(feature = "std")] use std::error;
/// A specialized [`Result`] type for `rustix` APIs. pubtype Result<T> = result::Result<T, Errno>;
#[cfg(feature = "std")] impl error::Error for Errno {}
#[cfg(feature = "std")] impl From<Errno> for std::io::Error { #[inline] fn from(err: Errno) -> Self { Self::from_raw_os_error(err.raw_os_error() as _)
}
}
/// Call `f` until it either succeeds or fails other than [`Errno::INTR`]. #[inline] pubfn retry_on_intr<T, F: FnMut() -> Result<T>>(mut f: F) -> Result<T> { loop { match f() {
Err(Errno::INTR) => (),
result => return result,
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-06-18)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.