Skip to main content

Sighting

Struct Sighting 

Source
#[non_exhaustive]
pub struct Sighting { pub format: FormatId, pub offset: u64, pub shape: &'static str, pub kind: SightingKind, pub more: u64, }
Expand description

A header a scanner SAW and has no gate for (Rulings S-V and 3-J): its structure is a header’s, and something about it — a field this build cannot check, a shape a shifted copy also takes — leaves the scan unable to tell it from a phantom. So it is counted here and never becomes a Candidate, because the engine advances past a candidate by its declared length and a phantom’s length is how a scan jumps a real header.

Why it has to be reported at all. A run that recovers nothing while seeing one refuses with Error::Unsupported (exit 3) — the scanner’s own job, since only it can name the shape. A run that recovered OTHER entries reports them at its ordinary exit code (Ruling S-X), and until Salvage Stage 3’s Task 2-N it said nothing else: an entry stuffr list shows was simply absent from salvage --list, at exit 0, with an empty stderr. The sightings recorded here are what the caller prints instead (describe_sightings), in a mixed run as in any other — and since the stage’s final review (I-1, reversing S-X for this case) a non-selective mixed run also exits 4, not 0: a salvage -C out && rm script must not delete an archive holding an entry stuffr list reads.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§format: FormatId

The scanner’s format, for the sentence describe_sightings writes.

§offset: u64

Where the header was seen.

§shape: &'static str

What was seen, as a plural noun phrase that follows a count — "header(s) whose magic field … is neither \ustar` nor blank“`. One phrase per shape, shared with the scanner’s own exit-3 refusal, so the two can never describe one shape two ways.

§kind: SightingKind

Why the header was not listed — which sentence describe_sightings reports it in.

§more: u64

How many further sightings of this same (format, shape, kind) a SightingLog saw but did not store, folded into this one. 0 from every constructor. describe_sightings adds it to the count it prints, so a capped log reports the same total as an uncapped one.

Implementations§

Source§

impl Sighting

Source

pub fn new(format: FormatId, offset: u64, shape: &'static str) -> Self

Source

pub fn with_more(self, more: u64) -> Self

This sighting standing for more further ones that were counted but not stored (see Sighting::more).

Source

pub fn work_bounded(format: FormatId, offset: u64, shape: &'static str) -> Self

Source

pub fn verdict_bounded( format: FormatId, offset: u64, shape: &'static str, ) -> Self

A SightingKind::VerdictBounded sighting: the candidate at offset was refused unexamined because the scan’s ScanBudget was spent.

Trait Implementations§

Source§

impl Clone for Sighting

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Sighting

Source§

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

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

impl Eq for Sighting

Source§

impl PartialEq for Sighting

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Sighting

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.