oct 0.28.0

Octonary transcodings.
Documentation
// 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/>.

//! Raw fields for [`io::Error`].
//!
//! [`io::Error`]: crate::io::Error

use crate::io::{ErrorKind, SimpleError};

#[cfg(feature = "alloc")]
use crate::io::CustomError;

#[cfg(feature = "std")]
use crate::io::RawOsError;

use core::fmt::Debug;

/// An unpacked error.
///
/// This enumeration wraps the decoded fields of an
/// [`Raw`] object. The generic denotes the custom
/// error type, which should be some pointer to
/// [`CustomError`].
#[derive(Clone, Copy, Debug)]
pub(super) enum UnpackedError {
	/// A simple error.
	Simple(&'static SimpleError),

	/// An inlined error.
	Inline(ErrorKind),

	/// A custom error.
	#[cfg(feature = "alloc")]
	Custom(*mut CustomError),

	/// An operating system error.
	#[cfg(feature = "std")]
	Os(RawOsError),
}