Crate codes_iso_17442

source ·
Expand description

This package contains an implementation of the ISO 17442 Legal Entity Identifier (LEI) specification.

The Legal Entity Identifier (LEI) is a unique global identifier for legal entities participating in financial transactions. Also known as an LEI code or LEI number, its purpose is to help identify legal entities on a globally accessible database. Legal entities are organisations such as companies or government entities that participate in financial transactions. The identifier is used in regulatory reporting to financial regulators and all financial companies and funds are required to have an LEI.

The ISO Specification defines a format for describing identifiers and including check digits to ensure validity. In turn The Global Legal Entity Identifier Foundation (GLEIF) is the top-level maintainer of the global registry of identifiers and as such has further refined the LEI format to contain the following components:

  1. Characters 1-4: Prefix used to ensure the uniqueness among codes from LEI issuers (Local Operating Units or LOUs).
  2. Characters 5-18: Entity-specific part of the code generated and assigned by LOUs according to transparent, sound and robust allocation policies. As required by ISO 17442, it contains no embedded intelligence.
  3. Characters 19-20: Two check digits as described in the ISO 17442 standard.

GLIEF also provides daily download files for all registered identifiers, and an LEI search API.

Example

use codes_iso_17442::LegalEntityId;
use std::str::FromStr;

let lei = LegalEntityId::from_str("YZ83GD8L7GG84979J516").unwrap();

assert_eq!(lei.local_operating_unit(), "YZ83");
assert_eq!(lei.entity(), "GD8L7GG84979J5");
assert_eq!(lei.check_digits(), "16");

Features

By default only the serde feature is enabled.

  • serde - Enables serialization of the LegalEntityId type.
  • url - Enables the conversion between LEI and URL (URN) forms.

Structs

The formatted Legal Entity Identifier (LEI) is formatted as a 20-character, alpha-numeric code based on the ISO 17442 standard developed by the International Organization for Standardization (ISO). It connects to key information that enables clear and unique identification of legal entities participating in financial transactions. Each LEI database entry contains information about an entity’s ownership and thus answers the questions of “who is who” and “who owns whom”. Therefore the publicly available LEI data pool can be regarded as a global directory of non-individual participants in the financial market.

Enums

Common Error type, mainly used for FromStr failures.

Constants

An instance of the Standard struct defined in the codes_agency package that describes the ISO-17442 specification.