Skip to main content

aster_forge_xml/
lib.rs

1//! Bounded, source-backed XML parsing for Aster services.
2//!
3//! Parsed documents use a flat arena and retain source spans for names, attributes, text, and
4//! subtrees. Values allocate only when XML decoding or configured normalization changes them.
5#![deny(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
6#![cfg_attr(
7    not(test),
8    deny(
9        clippy::unwrap_used,
10        clippy::unreachable,
11        clippy::expect_used,
12        clippy::panic,
13        clippy::unimplemented,
14        clippy::todo
15    )
16)]
17
18mod document;
19mod error;
20mod parser;
21mod stream;
22mod syntax;
23mod writer;
24
25pub use document::{
26    AttributeRef, Attributes, BorrowedDocument, ChildElements, Children, DescendantElements,
27    ElementRef, NodeId, NodeRef, OwnedDocument, ProcessingInstructionRef, SourceSpan, ValidatedXml,
28    XmlDocument,
29};
30pub use error::{Error, XmlSafetyError};
31pub use parser::{ParseOptions, XmlSafetyPolicy, validate_xml_input, xml_root_local_name};
32pub use stream::{
33    StreamAttribute, StreamAttributes, StreamCData, StreamComment, StreamEnd, StreamName,
34    StreamProcessingInstruction, StreamStart, StreamText, XmlStreamEvent, XmlStreamReader,
35};
36pub use writer::{XmlStreamWriter, XmlWriteAttribute, XmlWriteOptions};
37
38/// The default maximum nesting depth accepted from untrusted XML.
39pub const DEFAULT_XML_MAX_DEPTH: usize = 128;