// Copyright 2024-2025 Gabriel Bjørnager Jensen.
//
// This Source Code Form is subject to the terms of
// the Mozilla Public License, v. 2.0. If a copy of
// the MPL was not distributed with this file, you
// can obtain one at:
// <https://mozilla.org/MPL/2.0/>.
//! The [`CustomError`] type.
#![cfg(feature = "alloc")]
use crate::io::ErrorKind;
use alloc::boxed::Box;
// NOTE: Alignement ensures some padding bits in
// addresses.
/// A custom error.
#[cfg(feature = "alloc")]
#[repr(align(4))]
#[derive(Debug)]
pub(super) struct CustomError {
/// The error kind.
pub kind: ErrorKind,
/// The source error.
pub source: Box<dyn core::error::Error + Send + Sync>,
}