Skip to main content

Module core

Module core 

Source
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§

CompatReport
Result of a PowerPoint structural compatibility scan (legacy).
ElementPlacement
Position and optional size for a slide element, in EMU.
FlexPosition
A 2D position expressed in flexible dimensions.
FlexSize
A 2D size expressed in flexible dimensions.
PackageValidationIssue
A single structural issue found in a PPTX package.
PackageValidationReport
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.
ValidationCategory
Category grouping for validation findings (used in tests and filtering).
ValidationIssue
A validation issue found in a PPTX package or input value.
ValidationSeverity
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§

ElementSized
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§

RequiredPart
A required PPTX package part and its human-readable description.