VentumImportReport

Struct VentumImportReport 

Source
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: usize

How 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: usize

Arcs 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: usize

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

Source§

impl VentumImportReport

Source

pub fn is_empty(&self) -> bool

Whether anything at all was dropped. A caller that only wants to know “should I warn the user” asks this.

Source

pub fn tally(&self) -> String

The per-type tally as "arc x1, line x3", for a one-line notice. Empty string when nothing was dropped.

Trait Implementations§

Source§

impl Clone for VentumImportReport

Source§

fn clone(&self) -> VentumImportReport

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VentumImportReport

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for VentumImportReport

Source§

fn default() -> VentumImportReport

Returns the “default value” for a type. Read more
Source§

impl PartialEq for VentumImportReport

Source§

fn eq(&self, other: &VentumImportReport) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for VentumImportReport

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,