| Crates.io | iso17442-types |
| lib.rs | iso17442-types |
| version | 0.3.3 |
| created_at | 2025-03-30 06:39:57.282307+00 |
| updated_at | 2026-01-15 04:15:41.065165+00 |
| description | ISO 17442 Types |
| homepage | |
| repository | https://github.com/jcape/iso17442 |
| max_upload_size | |
| id | 1612104 |
| size | 27,040 |
This crate provides no-std, no-alloc 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 within static data.