Expand description
ISO 17442 Types
§ISO 17442 Types
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.
Structs§
Enums§
- Error
- An enumeration of errors