osom_lib_strings/immutable/
errors.rs1use osom_lib_alloc::traits::AllocationError;
2use osom_lib_primitives::length::LengthError;
3use osom_lib_reprc::macros::reprc;
4
5#[reprc]
7#[repr(u8)]
8#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
9pub enum ImmutableStringError {
10 AllocationError = 0,
12
13 MaxLengthExceeded = 1,
15}
16
17impl From<AllocationError> for ImmutableStringError {
18 fn from(_: AllocationError) -> Self {
19 Self::AllocationError
20 }
21}
22
23impl From<LengthError> for ImmutableStringError {
24 fn from(_: LengthError) -> Self {
25 Self::MaxLengthExceeded
26 }
27}