pub struct MatchingLicense {
pub license_id: Option<String>,
pub license_url: Option<String>,
pub normalized_url: Option<String>,
pub match_type: Option<String>,
pub confidence: Option<f64>,
pub spdx_id: Option<String>,
pub matched_name: Option<String>,
pub matched_catalog_url: Option<String>,
pub matched_source: Option<String>,
pub notes: Option<String>,
pub regional_id: Option<String>,
}Expand description
MatchingLicense : Matching a license
Fields§
§license_id: Option<String>Unique identifier for the license (typically SPDX ID)
license_url: Option<String>Original license URL provided for resolution
normalized_url: Option<String>URL after normalization (lowercased, trimmed, protocol removed)
match_type: Option<String>Type of match performed. One of: - ‘exact’: Direct match found in database - ‘heuristic’: Matched via pattern-based rules (CC resolver, common patterns) - ‘fuzzy’: Similarity-based match against same-host licenses
confidence: Option<f64>Match confidence score (0.0-1.0), examples: - 1.0: Exact match - 0.99: Creative Commons resolved - 0.95: Pattern heuristic match - 0.0-1.0: Fuzzy match score based on string similarity
spdx_id: Option<String>SPDX License Identifier if matched (e.g., ‘CC-BY-4.0’, ‘MIT’)
matched_name: Option<String>Human-readable name of the matched license
matched_catalog_url: Option<String>Canonical URL from the license catalog/database
matched_source: Option<String>Source of the match. Examples: - ‘db.license’: Exact match from database - ‘cc-resolver’: Creative Commons license resolver - ‘pattern-heuristics’: Generic pattern matching
notes: Option<String>Additional context about the match (e.g., version normalization, locale detection)
regional_id: Option<String>Regional/jurisdictional variant identifier for ported licenses (e.g., ‘CC-BY-2.1-jp’ for Japan-ported Creative Commons)
Implementations§
Source§impl MatchingLicense
impl MatchingLicense
Sourcepub fn new() -> MatchingLicense
pub fn new() -> MatchingLicense
Matching a license
Trait Implementations§
Source§impl Clone for MatchingLicense
impl Clone for MatchingLicense
Source§fn clone(&self) -> MatchingLicense
fn clone(&self) -> MatchingLicense
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more