iso17442-types

Crates.ioiso17442-types
lib.rsiso17442-types
version0.3.0
created_at2025-03-30 06:39:57.282307+00
updated_at2025-09-09 12:13:06.66479+00
descriptionISO 17442 Types
homepage
repositoryhttps://github.com/jcape/iso17442
max_upload_size
id1612104
size24,508
James Cape (jcape)

documentation

README

ISO 17442 Types

LicenseCrates.ioDocs StatusDependency Status

This crate provides no_std compatible data structures for use handling ISO 17442 Legal Entity IDs. The primary type is Lei, which is an owned (but non-heap) representation of an LEI string. For example:

use iso17442_types::Lei;
use core::str::FromStr;

const LEI_STR: &str = "YZ83GD8L7GG84979J516";

let l = Lei::from_str(LEI_STR).expect("Could not parse LEI");
let s = l.as_str();

assert_eq!(s, LEI_STR);

There is also an additional lei borrow type. This is the &str to Lei's String:

use iso17442_types::{Lei, lei};
use core::str::FromStr;

const LEI_STR: &str = "YZ83GD8L7GG84979J516";

let l = lei::from_str_slice(LEI_STR).expect("Could not parse LEI");

assert_eq!(l.as_str(), LEI_STR);

Both of these types are fully usable in the const context, making them suitable for use by static data.

Commit count: 18

cargo fmt