roxml 0.4.1

Read-only, zero-copy, lazy XML reader for no_std environments, without allocation
Documentation
// Copyright © 2026 Stephan Kunz
//! Roxml's errors.

use thiserror::Error;

/// Things that may go wrong during reading of the XML.
///
/// Errors are only reported by [`XmlReader::root_element`](crate::XmlReader::root_element),
/// which checks the structure of the whole document. Once a root element is
/// obtained, navigating below it cannot fail.
#[derive(Error, Debug, Clone, Copy, PartialEq, Eq)]
pub enum Error {
	/// The XML source contains no root element.
	#[error("no root element found")]
	NoRoot,
	/// The XML source is malformed, see [`XmlReader::root_element`](crate::XmlReader::root_element)
	/// for what is detected.
	#[error("malformed XML")]
	MalformedXml,
	/// Elements are nested deeper than [`MAX_DEPTH`](crate::MAX_DEPTH) levels.
	#[error("elements nested deeper than {} levels", crate::MAX_DEPTH)]
	TooDeep,
}