Expand description
Core traits and types for pptx-rs
This module provides the foundational traits that enable trait-based XML generation and consistent behavior across all PPTX elements.
Structs§
- Compat
Report - Result of a PowerPoint structural compatibility scan (legacy).
- Element
Placement - Position and optional size for a slide element, in EMU.
- Flex
Position - A 2D position expressed in flexible dimensions.
- Flex
Size - A 2D size expressed in flexible dimensions.
- Package
Validation Issue - A single structural issue found in a PPTX package.
- Package
Validation Report - Aggregated result of running all package validation rules.
- XmlWriter
- XML writer helper for building XML strings efficiently
Enums§
- Dimension
- A flexible dimension that can be expressed in multiple units.
- Validation
Category - Category grouping for validation findings (used in tests and filtering).
- Validation
Issue - A validation issue found in a PPTX package or input value.
- Validation
Severity - Severity of a package validation finding.
Constants§
- REQUIRED_
PACKAGE_ PARTS - Parts PowerPoint expects in every generated deck.
- REQUIRED_
PARTS_ MINIMAL - Minimum parts required for a readable PPTX (used by CLI validate and tests).
- REQUIRED_
PARTS_ REPAIR - Parts required for structural repair validation.
- SLIDE_
HEIGHT_ EMU - Standard slide height in EMU (7.5 inches)
- SLIDE_
WIDTH_ EMU - Standard slide width in EMU (10 inches)
Traits§
- Element
Sized - Trait for sized elements (width, height)
- Positioned
- Trait for positioned elements (x, y coordinates)
- ToXml
- Trait for types that can be converted to XML
Functions§
- append_
i32 - Append a signed integer without allocating a temporary
format!string. - append_
usize - Append a decimal integer without allocating a temporary
format!string. - check_
required_ parts - Check that all required part paths exist in
found. - check_
required_ parts_ with_ descriptions - Check required parts with descriptions (repair workflow).
- clamp_
ratio - Clamp a ratio to the 0.0–1.0 range.
- clamp_
unit_ interval - Clamp an opacity/alpha value to the 0.0–1.0 range.
- escape_
xml - Escape special XML characters
- validate_
index - Validate that a usize index is within
[0, count). - validate_
non_ empty - Validate that a collection is non-empty.
- validate_
non_ empty_ str - Validate that a string is non-empty after trimming.
- validate_
package - Validate a PPTX archive using all structural rules.
- validate_
package_ bytes - Validate PPTX bytes (opens a ZIP archive internally).
- validate_
positive - Validate that a value is strictly positive.
- validate_
powerpoint_ structure - Validate structural compatibility of a PPTX ZIP archive.
- validate_
well_ formed_ xml - Basic well-formedness check for XML / RELS content.
Type Aliases§
- Required
Part - A required PPTX package part and its human-readable description.