use core::alloc::Layout;
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct TryReserveError {
kind: TryReserveErrorKind,
}
impl TryReserveError {
#[inline]
#[must_use]
pub fn kind(&self) -> TryReserveErrorKind {
self.kind.clone()
}
}
#[derive(Clone, PartialEq, Eq, Debug)]
pub enum TryReserveErrorKind {
CapacityOverflow,
AllocError {
layout: Layout,
}
}
impl From<TryReserveErrorKind> for TryReserveError {
#[inline]
fn from(kind: TryReserveErrorKind) -> Self {
Self { kind }
}
}