1 2 3 4 5 6 7 8 9 10 11 12 13 14
use std::num; use crate::{Errno, kernel}; /// Access to the calling thread's native error slot. pub trait Source: kernel::raw::Source { fn try_get() -> Result<Option<Errno>, kernel::Invalid> { num::NonZero::new(Self::read()) .map(Errno::try_from) .transpose() } fn clear(); }