pub struct Match<'a> {
    pub score: f32,
    pub name: &'a str,
    pub license_type: LicenseType,
    pub data: &'a TextData,
}
Expand description

Information about text that was compared against licenses in the store.

This only contains information about the overall match; to uncover more data you can run methods like optimize_bounds on TextData.

Its lifetime is tied to the lifetime of the Store it was generated from.

Fields

score: f32

Confidence score of the match, ranging from 0 to 1.

name: &'a str

The name of the closest matching license in the Store. This will always be something that exists in the store, regardless of the score.

license_type: LicenseType

The type of the license that matched. Useful to know if the match was the complete text, a header, or something else.

data: &'a TextData

A reference to the license data that matched inside the Store. May be useful for diagnostic purposes or to further optimize the result.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. 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

Returns the argument unchanged.

Calls U::from(self).

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

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

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

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

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.