finish helper functions

This commit is contained in:
Vlasislav Kashin
2025-06-29 18:56:22 +03:00
parent 5f8bdd4b39
commit aa4220ed2d
16 changed files with 16910 additions and 6 deletions

View File

@@ -1,9 +1,12 @@
use crate::proto_gen::phonemetadata::PhoneNumberDesc;
/// Internal phonenumber matching API used to isolate the underlying
/// implementation of the matcher and allow different implementations to be
/// swapped in easily.
pub(crate) trait MatcherApi {
/// Returns whether the given national number (a string containing only decimal
/// digits) matches the national number pattern defined in the given
/// PhoneNumberDesc message.
fn match_national_number(number: &str, number_desc: &PhoneNumberDesc, allow_prefix_match: bool) -> bool;
fn match_national_number(&self, number: &str, number_desc: &PhoneNumberDesc, allow_prefix_match: bool) -> bool;
}