#swiss #uid #data-structures #mwst #mehrwertsteuer #ustid

swiss_uid

基于瑞士电子政务标准eCH-0098:2021的瑞士UID号码的Rust实现

3个稳定版本

新功能 1.0.2 2024年8月4日
1.0.1 2024年7月7日
1.0.0 2024年1月22日

财务类别中排名65

Download history 1/week @ 2024-06-29 115/week @ 2024-07-06 8/week @ 2024-07-13 114/week @ 2024-08-03

每月下载量125

MIT许可证

19KB
364

瑞士电子政务标准eCH-0097: 企业标识数据标准

该库根据数据标准eCH-0098:2021 5.2.0实现功能和数据结构

示例用法

use swiss_uid::uid::SwissUid;

// Using the new function:
let uid = SwissUid::new("CHE-109.322.551").unwrap();
assert_eq!(format!("{:?}", uid), "CHE-109.322.55[1]".to_owned()); // Debug output
assert_eq!(format!("{}", uid), "CHE-109.322.551".to_owned()); // Display output
assert_eq!(uid.to_string(), "CHE-109.322.551".to_owned()); // Display output
assert_eq!(uid.to_string_mwst(), "CHE-109.322.551 MWST".to_owned());
assert_eq!(uid.to_string_hr(), "CHE-109.322.551 HR".to_owned());

// Parse a string directly:
let uid2: SwissUid = "CHE-109.322.551".parse().unwrap();
assert_eq!(uid2.to_string().len(), 15);

依赖项

~775KB
~14K SLoC