use core::fmt::Display;
use osom_lib_alloc::traits::AllocationError;
use osom_lib_reprc::macros::reprc;
#[reprc]
#[repr(u8)]
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
#[must_use]
pub enum CArcError {
AllocationError = 0,
}
osom_lib_macros::unreachable_from_infallible!(CArcError);
impl Display for CArcError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
CArcError::AllocationError => write!(f, "CArcError::AllocationError"),
}
}
}
impl From<AllocationError> for CArcError {
fn from(_: AllocationError) -> Self {
Self::AllocationError
}
}
#[reprc]
#[repr(transparent)]
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
#[must_use]
pub struct MaxReferencesExceededError;
osom_lib_macros::unreachable_from_infallible!(MaxReferencesExceededError);
impl Display for MaxReferencesExceededError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "MaxReferencesExceededError")
}
}