Expand description
§isin
isin
provides an ISIN
type for working with validated International Securities
Identification Numbers (ISINs) as defined in ISO 6166:2021 Financial services — International securities
identification number (ISIN) (“The Standard”).
The Association of National Numbering Agencies (ANNA) has a page describing ISO 6166.
An ISIN is comprised of 12 ASCII characters with the following parts, in order:
- A two-letter Prefix in uppercase, designating the issuer’s country
of registration or legal domicile, or for OTC derivatives the special code
EZ
. Additional codes may be allocated by subsequent revisions to The Standard. Country codes follow the ISO 3166 standard. - A nine-character uppercase alphanumeric Basic Code assigned by the corresponding National Numbering Agency, zero-padded on the left if the underlying code is shorter than nine characters.
- A single decimal digit representing the Check Digit computed using what the standard calls the “modulus 10 ‘double-add-double’ check digit”.
Use the parse()
or parse_loose()
methods on the ISIN type to convert a string to a validated
ISIN.
§Related crates
This crate is part of the Financial Identifiers series:
- CUSIP: Committee on Uniform Security Identification Procedures (ANSI X9.6-2020)
- ISIN: International Securities Identification Number (ISO 6166:2021)
- LEI: Legal Entity Identifier (ISO 17442:2020)
§Optional features
Re-exports§
pub use error::Error;
Modules§
Structs§
- ISIN
- An ISIN in confirmed valid format.
Functions§
- build_
from_ parts - Build an ISIN from its parts: an Prefix and an Basic Code. The Check Digit is automatically computed.
- build_
from_ payload - Build an ISIN from a Payload (an already-concatenated Prefix and Basic Code). The Check Digit is automatically computed.
- parse
- Parse a string to a valid ISIN or an error message, requiring the string to already be only uppercase alphanumerics with no leading or trailing whitespace in addition to being the right length and format.
- parse_
loose - Parse a string to a valid ISIN or an error, allowing the string to contain leading or trailing whitespace and/or lowercase letters as long as it is otherwise the right length and format.
- validate
- Test whether or not the passed string is in valid ISIN format, without producing a ISIN struct value.