stack_cstr/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Copy, Clone, Debug, Default, Eq, Ord, PartialEq, PartialOrd, Hash)]
4#[error("Unexpected '\0' was found!")]
5pub struct ContainsNulError;
6
7#[derive(Error, Debug)]
8pub enum CStrError {
9    #[error(transparent)]
10    FormatError(#[from] core::fmt::Error),
11    #[error(transparent)]
12    OverflowError(#[from] arrayvec::CapacityError<char>),
13    #[error(transparent)]
14    FromBytesWithNulError(#[from] std::ffi::FromBytesWithNulError),
15    #[error(transparent)]
16    NulError(#[from] std::ffi::NulError),
17    #[error(transparent)]
18    ContainsNulError(#[from] ContainsNulError),
19}