import_reticle_document

Function import_reticle_document 

Source
pub fn import_reticle_document(
    xml: &str,
) -> Result<ReticleDescription, ReticleError>
Expand description

Import a .reticle XML document into a ReticleDescription.

xml is one .reticle document (see the module documentation for the grammar). The returned description is ready for hold_point_in_reticle: its marks are in milliradians from the zero, positive down_mil below it.

The description is always FocalPlane::First with reference_magnification = 1.0, because the format carries neither; a caller holding an SFP optic must overwrite both fields before solving.

This is a pure transform: like crate::reticle_import::import_ventum_reticle it does not itself reject an all-decoration document (the resulting description simply carries no marks, which hold_point_in_reticle then reports as ReticleError::NoMarks). It DOES enforce crate::reticle::MAX_RETICLE_MARKS while collecting.

Use import_reticle_document_with_report when you want to know what was dropped.

ยงErrors

Returns ReticleError::InvalidSpec if xml is not well-formed, is not rooted at <reticle>, or carries an attribute value this module cannot read as an angle (missing unit suffix, unrecognized unit, non-numeric, non-finite, non-positive canvas), and ReticleError::TooManyMarks if the document declares more <bdc> entries than the mark cap.