Struct stringsext::finding::Finding[][src]

pub struct Finding<'a> {
    pub input_file_id: Option<u8>,
    pub mission: &'static Mission,
    pub position: u64,
    pub position_precision: Precision,
    pub s: &'a str,
    pub s_completes_previous_s: bool,
}
Expand description

Finding represents a valid result string decoded to UTF-8 with it’s original location and its original encoding in the input stream.

Fields

input_file_id: Option<u8>

A label identifying the origin of the input data: If the origin of the data is stdin: None, otherwise: Some(1) for input coming from the first file, Some(2) for input from the second file, Some(3) for …

mission: &'static Mission

Mission associated with this finding. We need a reference to the corresponding Mission object here, in order to get additional information, e.g. the label of the encoding, when we print this Finding.

position: u64

The byte number position of this Finding in the input stream.

position_precision: Precision

In some cases the position can not be determined exactly. Therefor, position_precision indicates how well the finding is localized. In case that the position is not exactly known, we indicate if the finding is somewhere before or after position.

s: &'a str

Whatever the original encoding was, the result string s is always stored as UTF-8. s is a &str pointing into FindingCollection::output_buffer.

s_completes_previous_s: bool

This flag indicates that s holds only the second part of a cut finding from the previous scanner::scan() run. This can happen when a finding from the previous run has hit theinput_buffer-boundary.

Implementations

Trait Implementations

Formats the value using the given formatter. Read more

Useful to compare findings for debugging or testing.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

When itertools::kmerge() merges FindingCollections into an iterator over Finding s, it needs to compare Finding s. Therefor, we must implement PartialOrd.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.