pub struct VentumImportReport {
pub dropped_elements: usize,
pub dropped_element_types: Vec<(String, usize)>,
pub arcs: Vec<VentumArc>,
pub arcs_unresolved: usize,
pub circle_repeats_unreadable: usize,
}Expand description
What an import could not turn into a hold point, so a sparse reticle is explained rather
than merely suspicious. Returned by import_ventum_reticle_with_report.
§How the counts are taken
arc, circle and text entries count expanded instances. This report resolves each
arc instance’s own geometry, and a mirrored pair of horseshoes is genuinely two of them; an
unbound text is a lost LABEL rather than a lost shape, so a three-copy ladder that binds
to nothing has lost three of them. The one exception is a circle whose repeat this
module could not read: it is expanded as though it had none and so counts once, and
Self::circle_repeats_unreadable says how many elements that happened to, so the
shortfall is declared rather than hidden.
line, rect, grid and unknown types count elements as the document writes them — a
repeat on one of those counts once, since expansion reads no geometry from them and the
report carries none to tell a dropped shape’s copies from the shape itself.
Pinned by tests::a_repeat_counts_per_instance_for_text_and_once_for_a_dropped_shape.
Fields§
§dropped_elements: usizeHow many elements produced no hold point — the sum of Self::dropped_element_types.
Zero means the whole document is in the returned ReticleDescription.
dropped_element_types: Vec<(String, usize)>Per-type counts of that drop, sorted by tag so the report is deterministic. Tags are
the format’s own element types, plus ARC_TAG for a circle carrying a sweep and
"unknown" for an element type this module does not know. A "text" entry counts
only UNBOUND text: text that landed on a mark became its label and was not dropped.
arcs: Vec<VentumArc>Every dropped arc, resolved. See VentumArc and the module documentation.
arcs_unresolved: usizeArcs the document declared but this module could not resolve into points.
An arc’s apex and tips are built from three things — a center, a radius that is a
positive length, and a sweep — and the importer computes nothing without
all three. Anything that leaves one of them unavailable lands the arc here: a key the
document omitted, a value spelled in a type this module cannot read, or a radius that
reads perfectly well as a number and is not a length (0, or negative). Each of those
cases is driven through the importer by
tests::an_arc_resolves_only_from_a_center_a_positive_radius_and_a_sweep.
They are the SAME loss and land here for the same reason: an arc is reported so a
shooter can copy its apex and tips onto their reticle, and a coordinate derived from a
value nobody wrote is worse than no coordinate at all. They are counted in
Self::dropped_element_types under ARC_TAG like any other arc, so arcs.len()
plus this equals that tally — the discrepancy is stated rather than left to be
noticed.
circle_repeats_unreadable: usizeHow many circle elements declared a repeat this module could not read, so each was
expanded as though it had none and counted ONCE where the document may draw many.
A circle’s repeat is read leniently (see the serde section below) because a circle is never a hold point and must not be able to fail an import. That leniency costs the tally its accuracy for those elements, and this is the accounting for it: the count is low by an unknown amount, and the caller is told so instead of being handed a total that quietly is not one.
Implementations§
Trait Implementations§
Source§impl Clone for VentumImportReport
impl Clone for VentumImportReport
Source§fn clone(&self) -> VentumImportReport
fn clone(&self) -> VentumImportReport
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VentumImportReport
impl Debug for VentumImportReport
Source§impl Default for VentumImportReport
impl Default for VentumImportReport
Source§fn default() -> VentumImportReport
fn default() -> VentumImportReport
Source§impl PartialEq for VentumImportReport
impl PartialEq for VentumImportReport
impl StructuralPartialEq for VentumImportReport
Auto Trait Implementations§
impl Freeze for VentumImportReport
impl RefUnwindSafe for VentumImportReport
impl Send for VentumImportReport
impl Sync for VentumImportReport
impl Unpin for VentumImportReport
impl UnwindSafe for VentumImportReport
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.