pub struct HsPrediction {
pub hs_code: String,
pub heading_description: String,
pub confidence: f32,
pub source: PredictionSource,
pub notes: Vec<String>,
pub alternatives: Vec<AlternativePrediction>,
pub recommended_action: RecommendedAction,
pub gray_zone: Option<GrayZone>,
pub jp_tariff_code: Option<String>,
pub jp_tariff_year: Option<u16>,
}Expand description
HS code prediction result returned by the classification pipeline.
Fields§
§hs_code: StringSix-digit HS 2022 code without punctuation (e.g. "281511").
heading_description: StringOfficial HS 2022 heading description for this code.
confidence: f32Confidence score in the range [0.0, 1.0].
source: PredictionSourceWhich part of the pipeline produced this prediction.
notes: Vec<String>Supplementary notes (shape caveats, concentration notes, etc.).
alternatives: Vec<AlternativePrediction>Alternative HS codes worth considering.
recommended_action: RecommendedActionRecommended next action for the user.
gray_zone: Option<GrayZone>Classification boundary risk indicator (v0.5).
Some when the prediction falls in a well-known misclassification gray
zone (e.g. Chapter 29 vs 38 for organic preparations). When present,
consider requesting an advance ruling from customs authorities (事前教示).
jp_tariff_code: Option<String>Nine-digit Japan statistical item code (統計品目番号).
Based on Japan Customs 実行関税率表. Updated annually; the year used
is indicated by the jp_tariff_year field.
None when no Japan-specific code is registered for this HS heading.
jp_tariff_year: Option<u16>Tariff schedule year used for the jp_tariff_code field (e.g. 2026).
Implementations§
Source§impl HsPrediction
impl HsPrediction
Sourcepub fn chapter(&self) -> &str
pub fn chapter(&self) -> &str
Two-digit chapter code (e.g. "28").
Returns &self.hs_code unchanged if the code is shorter than 2 ASCII
digits (which should not happen for valid predictions).
Trait Implementations§
Source§impl Clone for HsPrediction
impl Clone for HsPrediction
Source§fn clone(&self) -> HsPrediction
fn clone(&self) -> HsPrediction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more