calling_code
ModuleCountry calling codes, and the one a phone number starts with.
Contents
use utopia_messaging::sms::calling_code::from_phone_number;pub fn from_phone_number(number: &str) -> Option<&'static str>The calling code a phone number starts with, longest match first, after
dropping +, spaces, parentheses and dashes, and an international
prefix (00 or 011).
pub const ALGERIA: &str = "213"+213.
pub const ALL: [(&str, &str); 187] = [ ("ALGERIA", ALGERIA), ("ANDORRA", ANDORRA), ("ANGOLA", ANGOLA), ("ARGENTINA", ARGENTINA), ("ARMENIA", ARMENIA), ("ARUBA", ARUBA), ("AUSTRALIA", AUSTRALIA), ("AUSTRIA", AUSTRIA), ("AZERBAIJAN", AZERBAIJAN), ("BAHRAIN", BAHRAIN), ("BANGLADESH", BANGLADESH), ("BELARUS", BELARUS), ("BELGIUM", BELGIUM), ("BELIZE", BELIZE), ("BENIN", BENIN), ("BHUTAN", BHUTAN), ("BOLIVIA", BOLIVIA), ("BOSNIA_HERZEGOVINA", BOSNIA_HERZEGOVINA), ("BOTSWANA", BOTSWANA), ("BRAZIL", BRAZIL), ("BRUNEI", BRUNEI), ("BULGARIA", BULGARIA), ("BURKINA_FASO", BURKINA_FASO), ("BURUNDI", BURUNDI), ("CAMBODIA", CAMBODIA), ("CAMEROON", CAMEROON), ("CAPE_VERDE_ISLANDS", CAPE_VERDE_ISLANDS), ("CENTRAL_AFRICAN_REPUBLIC", CENTRAL_AFRICAN_REPUBLIC), ("CHILE", CHILE),Every calling code with its constant's name, in declaration order.
pub const ANDORRA: &str = "376"+376.
pub const ANGOLA: &str = "244"+244.
pub const ARGENTINA: &str = "54"+54.
pub const ARMENIA: &str = "374"+374.
pub const ARUBA: &str = "297"+297.
pub const AUSTRALIA: &str = "61"+61.
pub const AUSTRIA: &str = "43"+43.
pub const AZERBAIJAN: &str = "994"+994.
pub const BAHRAIN: &str = "973"+973.
pub const BANGLADESH: &str = "880"+880.
pub const BELARUS: &str = "375"+375.
pub const BELGIUM: &str = "32"+32.
pub const BELIZE: &str = "501"+501.
pub const BENIN: &str = "229"+229.
pub const BHUTAN: &str = "975"+975.
pub const BOLIVIA: &str = "591"+591.
pub const BOSNIA_HERZEGOVINA: &str = "387"+387.
pub const BOTSWANA: &str = "267"+267.
pub const BRAZIL: &str = "55"+55.
pub const BRUNEI: &str = "673"+673.
pub const BULGARIA: &str = "359"+359.
pub const BURKINA_FASO: &str = "226"+226.
pub const BURUNDI: &str = "257"+257.
pub const CAMBODIA: &str = "855"+855.
pub const CAMEROON: &str = "237"+237.
pub const CAPE_VERDE_ISLANDS: &str = "238"+238.
pub const CENTRAL_AFRICAN_REPUBLIC: &str = "236"+236.
pub const CHILE: &str = "56"+56.
pub const CHINA: &str = "86"+86.
pub const COLOMBIA: &str = "57"+57.
pub const COMOROS_AND_MAYOTTE: &str = "269"+269.
pub const CONGO: &str = "242"+242.
pub const COOK_ISLANDS: &str = "682"+682.
pub const COSTA_RICA: &str = "506"+506.
pub const CROATIA: &str = "385"+385.
pub const CUBA: &str = "53"+53.
pub const CYPRUS: &str = "357"+357.
pub const CZECH_REPUBLIC: &str = "420"+420.
pub const DENMARK: &str = "45"+45.
pub const DJIBOUTI: &str = "253"+253.
pub const ECUADOR: &str = "593"+593.
pub const EGYPT: &str = "20"+20.
pub const EL_SALVADOR: &str = "503"+503.
pub const EQUATORIAL_GUINEA: &str = "240"+240.
pub const ERITREA: &str = "291"+291.
pub const ESTONIA: &str = "372"+372.
pub const ETHIOPIA: &str = "251"+251.
pub const FALKLAND_ISLANDS: &str = "500"+500.
pub const FAROE_ISLANDS: &str = "298"+298.
pub const FIJI: &str = "679"+679.
pub const FINLAND: &str = "358"+358.
pub const FRANCE: &str = "33"+33.
pub const FRENCH_GUIANA: &str = "594"+594.
pub const FRENCH_POLYNESIA: &str = "689"+689.
pub const GABON: &str = "241"+241.
pub const GAMBIA: &str = "220"+220.
pub const GEORGIA: &str = "995"+995.
pub const GERMANY: &str = "49"+49.
pub const GHANA: &str = "233"+233.
pub const GIBRALTAR: &str = "350"+350.
pub const GREECE: &str = "30"+30.
pub const GREENLAND: &str = "299"+299.
pub const GUADELOUPE: &str = "590"+590.
pub const GUAM: &str = "671"+671.
pub const GUATEMALA: &str = "502"+502.
pub const GUINEA: &str = "224"+224.
pub const GUINEA_BISSAU: &str = "245"+245.
pub const GUYANA: &str = "592"+592.
pub const HAITI: &str = "509"+509.
pub const HONDURAS: &str = "504"+504.
pub const HONG_KONG: &str = "852"+852.
pub const HUNGARY: &str = "36"+36.
pub const ICELAND: &str = "354"+354.
pub const INDIA: &str = "91"+91.
pub const INDONESIA: &str = "62"+62.
pub const IRAN: &str = "98"+98.
pub const IRAQ: &str = "964"+964.
pub const IRELAND: &str = "353"+353.
pub const ISRAEL: &str = "972"+972.
pub const ITALY: &str = "39"+39.
pub const JAPAN: &str = "81"+81.
pub const JORDAN: &str = "962"+962.
pub const KENYA: &str = "254"+254.
pub const KIRIBATI: &str = "686"+686.
pub const KUWAIT: &str = "965"+965.
pub const KYRGYZSTAN: &str = "996"+996.
pub const LAOS: &str = "856"+856.
pub const LATVIA: &str = "371"+371.
pub const LEBANON: &str = "961"+961.
pub const LESOTHO: &str = "266"+266.
pub const LIBERIA: &str = "231"+231.
pub const LIBYA: &str = "218"+218.
pub const LIECHTENSTEIN: &str = "423"+423.
pub const LITHUANIA: &str = "370"+370.
pub const LUXEMBOURG: &str = "352"+352.
pub const MACAO: &str = "853"+853.
pub const MACEDONIA: &str = "389"+389.
pub const MADAGASCAR: &str = "261"+261.
pub const MALAWI: &str = "265"+265.
pub const MALAYSIA: &str = "60"+60.
pub const MALDIVES: &str = "960"+960.
pub const MALI: &str = "223"+223.
pub const MALTA: &str = "356"+356.
pub const MARSHALL_ISLANDS: &str = "692"+692.
pub const MARTINIQUE: &str = "596"+596.
pub const MAURITANIA: &str = "222"+222.
pub const MEXICO: &str = "52"+52.
pub const MICRONESIA: &str = "691"+691.
pub const MOLDOVA: &str = "373"+373.
pub const MONACO: &str = "377"+377.
pub const MONGOLIA: &str = "976"+976.
pub const MOROCCO: &str = "212"+212.
pub const MOZAMBIQUE: &str = "258"+258.
pub const MYANMAR: &str = "95"+95.
pub const NAMIBIA: &str = "264"+264.
pub const NAURU: &str = "674"+674.
pub const NEPAL: &str = "977"+977.
pub const NETHERLANDS: &str = "31"+31.
pub const NEW_CALEDONIA: &str = "687"+687.
pub const NEW_ZEALAND: &str = "64"+64.
pub const NICARAGUA: &str = "505"+505.
pub const NIGER: &str = "227"+227.
pub const NIGERIA: &str = "234"+234.
pub const NIUE: &str = "683"+683.
pub const NORFOLK_ISLANDS: &str = "672"+672.
pub const NORTH_AMERICA: &str = "1"+1.
pub const NORTH_KOREA: &str = "850"+850.
pub const NORTHERN_MARIANA_ISLANDS: &str = "670"+670.
pub const NORWAY: &str = "47"+47.
pub const OMAN: &str = "968"+968.
pub const PALAU: &str = "680"+680.
pub const PANAMA: &str = "507"+507.
pub const PAPUA_NEW_GUINEA: &str = "675"+675.
pub const PARAGUAY: &str = "595"+595.
pub const PERU: &str = "51"+51.
pub const PHILIPPINES: &str = "63"+63.
pub const POLAND: &str = "48"+48.
pub const PORTUGAL: &str = "351"+351.
pub const QATAR: &str = "974"+974.
pub const REUNION: &str = "262"+262.
pub const ROMANIA: &str = "40"+40.
pub const RUSSIA_KAZAKHSTAN_UZBEKISTAN_TURKMENISTAN_AND_TAJIKSTAN: &str = "7"+7.
pub const RWANDA: &str = "250"+250.
pub const SAN_MARINO: &str = "378"+378.
pub const SAO_TOME_AND_PRINCIPE: &str = "239"+239.
pub const SAUDI_ARABIA: &str = "966"+966.
pub const SENEGAL: &str = "221"+221.
pub const SERBIA: &str = "381"+381.
pub const SEYCHELLES: &str = "248"+248.
pub const SIERRA_LEONE: &str = "232"+232.
pub const SINGAPORE: &str = "65"+65.
pub const SLOVAK_REPUBLIC: &str = "421"+421.
pub const SLOVENIA: &str = "386"+386.
pub const SOLOMON_ISLANDS: &str = "677"+677.
pub const SOMALIA: &str = "252"+252.
pub const SOUTH_AFRICA: &str = "27"+27.
pub const SOUTH_KOREA: &str = "82"+82.
pub const SPAIN: &str = "34"+34.
pub const SRI_LANKA: &str = "94"+94.
pub const ST_HELENA: &str = "290"+290.
pub const SUDAN: &str = "249"+249.
pub const SURINAME: &str = "597"+597.
pub const SWAZILAND: &str = "268"+268.
pub const SWEDEN: &str = "46"+46.
pub const SWITZERLAND: &str = "41"+41.
pub const SYRIA: &str = "963"+963.
pub const TAIWAN: &str = "886"+886.
pub const THAILAND: &str = "66"+66.
pub const TOGO: &str = "228"+228.
pub const TONGA: &str = "676"+676.
pub const TUNISIA: &str = "216"+216.
pub const TURKEY: &str = "90"+90.
pub const TUVALU: &str = "688"+688.
pub const UGANDA: &str = "256"+256.
pub const UKRAINE: &str = "380"+380.
pub const UNITED_ARAB_EMIRATES: &str = "971"+971.
pub const UNITED_KINGDOM: &str = "44"+44.
pub const URUGUAY: &str = "598"+598.
pub const VANUATU: &str = "678"+678.
pub const VENEZUELA: &str = "58"+58.
pub const VIETNAM: &str = "84"+84.
pub const WALLIS_AND_FUTUNA: &str = "681"+681.
pub const YEMEN: &str = "967"+967.
pub const ZAMBIA: &str = "260"+260.
pub const ZANZIBAR: &str = "255"+255.
pub const ZIMBABWE: &str = "263"+263.