Rust

calling_code

Module

Country calling codes, and the one a phone number starts with.

Contents

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

Rust
pub const ALGERIA: &str = "213"

+213.

Rust
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.

Rust
pub const ANDORRA: &str = "376"

+376.

Rust
pub const ANGOLA: &str = "244"

+244.

Rust
pub const ARGENTINA: &str = "54"

+54.

Rust
pub const ARMENIA: &str = "374"

+374.

Rust
pub const ARUBA: &str = "297"

+297.

Rust
pub const AUSTRALIA: &str = "61"

+61.

Rust
pub const AUSTRIA: &str = "43"

+43.

Rust
pub const AZERBAIJAN: &str = "994"

+994.

Rust
pub const BAHRAIN: &str = "973"

+973.

Rust
pub const BANGLADESH: &str = "880"

+880.

Rust
pub const BELARUS: &str = "375"

+375.

Rust
pub const BELGIUM: &str = "32"

+32.

Rust
pub const BELIZE: &str = "501"

+501.

Rust
pub const BENIN: &str = "229"

+229.

Rust
pub const BHUTAN: &str = "975"

+975.

Rust
pub const BOLIVIA: &str = "591"

+591.

Rust
pub const BOSNIA_HERZEGOVINA: &str = "387"

+387.

Rust
pub const BOTSWANA: &str = "267"

+267.

Rust
pub const BRAZIL: &str = "55"

+55.

Rust
pub const BRUNEI: &str = "673"

+673.

Rust
pub const BULGARIA: &str = "359"

+359.

Rust
pub const BURKINA_FASO: &str = "226"

+226.

Rust
pub const BURUNDI: &str = "257"

+257.

Rust
pub const CAMBODIA: &str = "855"

+855.

Rust
pub const CAMEROON: &str = "237"

+237.

Rust
pub const CAPE_VERDE_ISLANDS: &str = "238"

+238.

Rust
pub const CENTRAL_AFRICAN_REPUBLIC: &str = "236"

+236.

Rust
pub const CHILE: &str = "56"

+56.

Rust
pub const CHINA: &str = "86"

+86.

Rust
pub const COLOMBIA: &str = "57"

+57.

Rust
pub const COMOROS_AND_MAYOTTE: &str = "269"

+269.

Rust
pub const CONGO: &str = "242"

+242.

Rust
pub const COOK_ISLANDS: &str = "682"

+682.

Rust
pub const COSTA_RICA: &str = "506"

+506.

Rust
pub const CROATIA: &str = "385"

+385.

Rust
pub const CUBA: &str = "53"

+53.

Rust
pub const CYPRUS: &str = "357"

+357.

Rust
pub const CZECH_REPUBLIC: &str = "420"

+420.

Rust
pub const DENMARK: &str = "45"

+45.

Rust
pub const DJIBOUTI: &str = "253"

+253.

Rust
pub const ECUADOR: &str = "593"

+593.

Rust
pub const EGYPT: &str = "20"

+20.

Rust
pub const EL_SALVADOR: &str = "503"

+503.

Rust
pub const EQUATORIAL_GUINEA: &str = "240"

+240.

Rust
pub const ERITREA: &str = "291"

+291.

Rust
pub const ESTONIA: &str = "372"

+372.

Rust
pub const ETHIOPIA: &str = "251"

+251.

Rust
pub const FALKLAND_ISLANDS: &str = "500"

+500.

Rust
pub const FAROE_ISLANDS: &str = "298"

+298.

Rust
pub const FIJI: &str = "679"

+679.

Rust
pub const FINLAND: &str = "358"

+358.

Rust
pub const FRANCE: &str = "33"

+33.

Rust
pub const FRENCH_GUIANA: &str = "594"

+594.

Rust
pub const FRENCH_POLYNESIA: &str = "689"

+689.

Rust
pub const GABON: &str = "241"

+241.

Rust
pub const GAMBIA: &str = "220"

+220.

Rust
pub const GEORGIA: &str = "995"

+995.

Rust
pub const GERMANY: &str = "49"

+49.

Rust
pub const GHANA: &str = "233"

+233.

Rust
pub const GIBRALTAR: &str = "350"

+350.

Rust
pub const GREECE: &str = "30"

+30.

Rust
pub const GREENLAND: &str = "299"

+299.

Rust
pub const GUADELOUPE: &str = "590"

+590.

Rust
pub const GUAM: &str = "671"

+671.

Rust
pub const GUATEMALA: &str = "502"

+502.

Rust
pub const GUINEA: &str = "224"

+224.

Rust
pub const GUINEA_BISSAU: &str = "245"

+245.

Rust
pub const GUYANA: &str = "592"

+592.

Rust
pub const HAITI: &str = "509"

+509.

Rust
pub const HONDURAS: &str = "504"

+504.

Rust
pub const HONG_KONG: &str = "852"

+852.

Rust
pub const HUNGARY: &str = "36"

+36.

Rust
pub const ICELAND: &str = "354"

+354.

Rust
pub const INDIA: &str = "91"

+91.

Rust
pub const INDONESIA: &str = "62"

+62.

Rust
pub const IRAN: &str = "98"

+98.

Rust
pub const IRAQ: &str = "964"

+964.

Rust
pub const IRELAND: &str = "353"

+353.

Rust
pub const ISRAEL: &str = "972"

+972.

Rust
pub const ITALY: &str = "39"

+39.

Rust
pub const JAPAN: &str = "81"

+81.

Rust
pub const JORDAN: &str = "962"

+962.

Rust
pub const KENYA: &str = "254"

+254.

Rust
pub const KIRIBATI: &str = "686"

+686.

Rust
pub const KUWAIT: &str = "965"

+965.

Rust
pub const KYRGYZSTAN: &str = "996"

+996.

Rust
pub const LAOS: &str = "856"

+856.

Rust
pub const LATVIA: &str = "371"

+371.

Rust
pub const LEBANON: &str = "961"

+961.

Rust
pub const LESOTHO: &str = "266"

+266.

Rust
pub const LIBERIA: &str = "231"

+231.

Rust
pub const LIBYA: &str = "218"

+218.

Rust
pub const LIECHTENSTEIN: &str = "423"

+423.

Rust
pub const LITHUANIA: &str = "370"

+370.

Rust
pub const LUXEMBOURG: &str = "352"

+352.

Rust
pub const MACAO: &str = "853"

+853.

Rust
pub const MACEDONIA: &str = "389"

+389.

Rust
pub const MADAGASCAR: &str = "261"

+261.

Rust
pub const MALAWI: &str = "265"

+265.

Rust
pub const MALAYSIA: &str = "60"

+60.

Rust
pub const MALDIVES: &str = "960"

+960.

Rust
pub const MALI: &str = "223"

+223.

Rust
pub const MALTA: &str = "356"

+356.

Rust
pub const MARSHALL_ISLANDS: &str = "692"

+692.

Rust
pub const MARTINIQUE: &str = "596"

+596.

Rust
pub const MAURITANIA: &str = "222"

+222.

Rust
pub const MEXICO: &str = "52"

+52.

Rust
pub const MICRONESIA: &str = "691"

+691.

Rust
pub const MOLDOVA: &str = "373"

+373.

Rust
pub const MONACO: &str = "377"

+377.

Rust
pub const MONGOLIA: &str = "976"

+976.

Rust
pub const MOROCCO: &str = "212"

+212.

Rust
pub const MOZAMBIQUE: &str = "258"

+258.

Rust
pub const MYANMAR: &str = "95"

+95.

Rust
pub const NAMIBIA: &str = "264"

+264.

Rust
pub const NAURU: &str = "674"

+674.

Rust
pub const NEPAL: &str = "977"

+977.

Rust
pub const NETHERLANDS: &str = "31"

+31.

Rust
pub const NEW_CALEDONIA: &str = "687"

+687.

Rust
pub const NEW_ZEALAND: &str = "64"

+64.

Rust
pub const NICARAGUA: &str = "505"

+505.

Rust
pub const NIGER: &str = "227"

+227.

Rust
pub const NIGERIA: &str = "234"

+234.

Rust
pub const NIUE: &str = "683"

+683.

Rust
pub const NORFOLK_ISLANDS: &str = "672"

+672.

Rust
pub const NORTH_AMERICA: &str = "1"

+1.

Rust
pub const NORTH_KOREA: &str = "850"

+850.

Rust
pub const NORTHERN_MARIANA_ISLANDS: &str = "670"

+670.

Rust
pub const NORWAY: &str = "47"

+47.

Rust
pub const OMAN: &str = "968"

+968.

Rust
pub const PALAU: &str = "680"

+680.

Rust
pub const PANAMA: &str = "507"

+507.

Rust
pub const PAPUA_NEW_GUINEA: &str = "675"

+675.

Rust
pub const PARAGUAY: &str = "595"

+595.

Rust
pub const PERU: &str = "51"

+51.

Rust
pub const PHILIPPINES: &str = "63"

+63.

Rust
pub const POLAND: &str = "48"

+48.

Rust
pub const PORTUGAL: &str = "351"

+351.

Rust
pub const QATAR: &str = "974"

+974.

Rust
pub const REUNION: &str = "262"

+262.

Rust
pub const ROMANIA: &str = "40"

+40.

Rust
pub const RUSSIA_KAZAKHSTAN_UZBEKISTAN_TURKMENISTAN_AND_TAJIKSTAN: &str = "7"

+7.

Rust
pub const RWANDA: &str = "250"

+250.

Rust
pub const SAN_MARINO: &str = "378"

+378.

Rust
pub const SAO_TOME_AND_PRINCIPE: &str = "239"

+239.

Rust
pub const SAUDI_ARABIA: &str = "966"

+966.

Rust
pub const SENEGAL: &str = "221"

+221.

Rust
pub const SERBIA: &str = "381"

+381.

Rust
pub const SEYCHELLES: &str = "248"

+248.

Rust
pub const SIERRA_LEONE: &str = "232"

+232.

Rust
pub const SINGAPORE: &str = "65"

+65.

Rust
pub const SLOVAK_REPUBLIC: &str = "421"

+421.

Rust
pub const SLOVENIA: &str = "386"

+386.

Rust
pub const SOLOMON_ISLANDS: &str = "677"

+677.

Rust
pub const SOMALIA: &str = "252"

+252.

Rust
pub const SOUTH_AFRICA: &str = "27"

+27.

Rust
pub const SOUTH_KOREA: &str = "82"

+82.

Rust
pub const SPAIN: &str = "34"

+34.

Rust
pub const SRI_LANKA: &str = "94"

+94.

Rust
pub const ST_HELENA: &str = "290"

+290.

Rust
pub const SUDAN: &str = "249"

+249.

Rust
pub const SURINAME: &str = "597"

+597.

Rust
pub const SWAZILAND: &str = "268"

+268.

Rust
pub const SWEDEN: &str = "46"

+46.

Rust
pub const SWITZERLAND: &str = "41"

+41.

Rust
pub const SYRIA: &str = "963"

+963.

Rust
pub const TAIWAN: &str = "886"

+886.

Rust
pub const THAILAND: &str = "66"

+66.

Rust
pub const TOGO: &str = "228"

+228.

Rust
pub const TONGA: &str = "676"

+676.

Rust
pub const TUNISIA: &str = "216"

+216.

Rust
pub const TURKEY: &str = "90"

+90.

Rust
pub const TUVALU: &str = "688"

+688.

Rust
pub const UGANDA: &str = "256"

+256.

Rust
pub const UKRAINE: &str = "380"

+380.

Rust
pub const UNITED_ARAB_EMIRATES: &str = "971"

+971.

Rust
pub const UNITED_KINGDOM: &str = "44"

+44.

Rust
pub const URUGUAY: &str = "598"

+598.

Rust
pub const VANUATU: &str = "678"

+678.

Rust
pub const VENEZUELA: &str = "58"

+58.

Rust
pub const VIETNAM: &str = "84"

+84.

Rust
pub const WALLIS_AND_FUTUNA: &str = "681"

+681.

Rust
pub const YEMEN: &str = "967"

+967.

Rust
pub const ZAMBIA: &str = "260"

+260.

Rust
pub const ZANZIBAR: &str = "255"

+255.

Rust
pub const ZIMBABWE: &str = "263"

+263.