Implementation:Avhz RustQuant ISIN
| Knowledge Sources | |
|---|---|
| Domains | Financial_Standards, Quantitative_Finance |
| Last Updated | 2026-02-07 19:00 GMT |
Overview
Concrete tool for representing International Securities Identification Numbers (ISINs) provided by the RustQuant library.
Description
The ISIN struct models an International Securities Identification Number as defined by the ISO 6166 standard. An ISIN uniquely identifies a security globally and consists of three parts: a two-letter ISO 3166-1 alpha-2 country code indicating the country of issue, a nine-character National Securities Identifying Number (NSIN), and a single check digit for validation. For example, Apple Inc.'s ISIN is US0378331005, where "US" is the country code, "037833100" is the NSIN, and "5" is the check digit. All fields are stored as static string references for compile-time efficiency.
Usage
Use this struct when you need to represent, store, or validate ISIN codes for securities identification in financial data processing, trade settlement, or instrument lookup systems.
Code Reference
Source Location
- Repository: RustQuant
- File: crates/RustQuant_iso/src/isin.rs
- Lines: 1-25
Signature
pub struct ISIN {
pub country_code: &'static str,
pub nsin: &'static str,
pub check_digit: &'static str,
}
Import
use RustQuant::iso::ISIN;
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| country_code | &'static str | Yes | ISO 3166-1 alpha-2 country code (e.g., "US") |
| nsin | &'static str | Yes | National Securities Identifying Number (9 characters) |
| check_digit | &'static str | Yes | Single-digit checksum for ISIN validation |
Outputs
| Name | Type | Description |
|---|---|---|
| ISIN | struct | A structured representation of an International Securities Identification Number |
Usage Examples
use RustQuant::iso::ISIN;
// Represent Apple Inc.'s ISIN: US0378331005
let apple_isin = ISIN {
country_code: "US",
nsin: "037833100",
check_digit: "5",
};
assert_eq!(apple_isin.country_code, "US");
assert_eq!(apple_isin.nsin, "037833100");
assert_eq!(apple_isin.check_digit, "5");