use core::fmt::Display;
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"),
}
}
}
#[reprc]
#[repr(u8)]
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
#[must_use]
pub enum CArcArrayError {
AllocationError = 0,
ArraySizeOutOfRange = 1,
}
osom_lib_macros::unreachable_from_infallible!(CArcArrayError);
impl Display for CArcArrayError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
CArcArrayError::AllocationError => write!(f, "CArcArrayError::AllocationError"),
CArcArrayError::ArraySizeOutOfRange => write!(f, "CArcArrayError::ArraySizeOutOfRange"),
}
}
}
#[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")
}
}
#[reprc]
#[repr(u8)]
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
#[must_use]
pub enum WeakUpgradeError {
MaxReferencesExceeded = 0,
NoStrongReferencesAlive = 1,
}