Crate lei

source ·
Expand description

lei

lei provides an LEI type for working with validated Legal Entity Identifiers (LEIs) as defined in ISO 17442-1:2020 “Financial services — Legal entity identifier (LEI) — Part 1: Assignment” (“The Standard”).

An LEI is comprised of 20 ASCII characters with the following parts, in order:

  1. A four-character uppercase alphanumeric LOU Identifier corresponding to the Local Operating Unit that issued the LEI, according to the GLEIF web site.
  2. A 14-character uppercase alphanumeric Entity Identifier assigned by the corresponding LOU.
  3. Two decimal digits representing the Check Digit Pair computed using a method based on the ISO/IEC 7064, MOD 97-10 Check Character System.

Use the parse() or parse_loose() methods on the LEI type to convert a string to a validated LEI.

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)

The referenced ISO/IEC 7064, MOD 97-10 Check Character System is implemented in:

Re-exports

pub use error::LEIError;

Modules

lei::error

Structs

An LEI in confirmed valid format.

Functions

Build an LEI from its parts: an LOU ID and an Entity ID. The Check Digits are automatically computed.
Build an LEI from a Payload (an already-concatenated LOU ID and Entity ID). The Check Digits are automatically computed.
Parse a string to a valid LEI 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 a string to a valid LEI 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.
Test whether or not the passed string is in valid LEI format, without producing an LEI struct value.