added more functions from original code, added macro

This commit is contained in:
Vlasislav Kashin
2025-07-02 18:02:47 +03:00
parent 929fdbae8a
commit d0fb47705a
14 changed files with 1177 additions and 41 deletions

View File

@@ -1,13 +1,17 @@
mod helper_constants;
pub mod helper_functions;
mod errors;
mod enums;
mod phonenumberutil;
mod regex_and_mappings;
mod phone_number_regexps_and_mappings;
use std::sync::LazyLock;
pub use enums::{MatchType, PhoneNumberFormat, PhoneNumberType, ValidationResultErr, ValidNumberLenType};
use thiserror::Error;
use crate::phonenumberutil::phonenumberutil::PhoneNumberUtil;
#[derive(Debug, Error)]
pub enum ErrorType {
#[error("No parsing")]
@@ -23,3 +27,7 @@ pub enum ErrorType {
#[error("Too long nsn")]
TooLongNsn, // TOO_LONG in the java version.
}
static PHONE_NUMBER_UTIL: LazyLock<PhoneNumberUtil> = LazyLock::new(|| {
PhoneNumberUtil::new()
});