phonenumber_fixed/
lib.rs

1// Copyright (C) 2017 1aim GmbH
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#![recursion_limit = "1024"]
16
17#[macro_use]
18extern crate lazy_static;
19
20extern crate thiserror;
21#[macro_use]
22extern crate nom;
23
24extern crate regex;
25extern crate regex_cache;
26extern crate fnv;
27extern crate quick_xml as xml;
28extern crate itertools;
29extern crate either;
30
31extern crate serde;
32#[macro_use]
33extern crate serde_derive;
34extern crate bincode;
35
36#[cfg(test)]
37#[macro_use]
38extern crate doc_comment;
39
40#[cfg(test)]
41doctest!("../README.md");
42
43#[macro_use]
44mod helper;
45
46/// Errors for various parts of the crate.
47mod error;
48pub use crate::error::{Metadata as MetadataError, Parse as ParseError};
49
50/// Phone number metadata, containing patterns, formatting and other useful
51/// data about countries and phone numbers.
52pub mod metadata;
53pub use crate::metadata::Metadata;
54
55/// Country related types.
56pub mod country;
57
58mod consts;
59
60mod national_number;
61pub use crate::national_number::NationalNumber;
62
63
64mod extension;
65pub use crate::extension::Extension;
66
67mod carrier;
68pub use crate::carrier::Carrier;
69
70mod phone_number;
71pub use crate::phone_number::{PhoneNumber, Type};
72
73mod parser;
74pub use crate::parser::{parse, parse_with};
75
76mod formatter;
77pub use crate::formatter::{Mode, Formatter, format, format_with};
78
79mod validator;
80pub use crate::validator::{Validation, is_viable, is_valid, is_valid_with};