Enum google_maps::Region

source ·
#[non_exhaustive]
#[repr(u16)]
pub enum Region {
Show 256 variants AlandIslands = 0, Afghanistan = 1, Albania = 2, Algeria = 3, AmericanSamoa = 4, Andorra = 5, Angola = 6, Anguilla = 7, Antarctica = 8, AntiguaAndBarbuda = 9, Argentina = 10, Armenia = 11, Aruba = 12, AscensionIsland = 13, Australia = 14, Austria = 15, Azerbaijan = 16, Bahamas = 17, Bahrain = 18, Bangladesh = 19, Barbados = 20, Belarus = 21, Belgium = 22, Belize = 23, Benin = 24, Bermuda = 25, Bhutan = 26, Bolivia = 27, BosniaAndHerzegovina = 28, Botswana = 29, BouvetIsland = 30, Brazil = 31, BritishIndianOceanTerritory = 32, BritishVirginIslands = 33, Brunei = 34, Bulgaria = 35, BurkinaFaso = 36, Burundi = 37, Cambodia = 38, Cameroon = 39, Canada = 40, CanaryIslands = 41, CapeVerde = 42, CaribbeanNetherlands = 43, CaymanIslands = 44, CentralAfricanRepublic = 45, CeutaAndMelilla = 46, Chad = 47, Chile = 48, China = 49, ChristmasIsland = 50, ClippertonIsland = 51, CocosKeelingIslands = 52, Colombia = 53, Comoros = 54, CongoBrazzaville = 55, CongoKinshasa = 56, CookIslands = 57, CostaRica = 58, CotedIvoire = 59, Croatia = 60, Cuba = 61, Curacao = 62, Cyprus = 63, Czechia = 64, Denmark = 65, DiegoGarcia = 66, Djibouti = 67, Dominica = 68, DominicanRepublic = 69, Ecuador = 70, Egypt = 71, ElSalvador = 72, EquatorialGuinea = 73, Eritrea = 74, Estonia = 75, Eswatini = 76, Ethiopia = 77, FalklandIslands = 78, FaroeIslands = 79, Fiji = 80, Finland = 81, France = 82, FrenchGuiana = 83, FrenchPolynesia = 84, FrenchSouthernTerritories = 85, Gabon = 86, Gambia = 87, Georgia = 88, Germany = 89, Ghana = 90, Gibraltar = 91, Greece = 92, Greenland = 93, Grenada = 94, Guadeloupe = 95, Guam = 96, Guatemala = 97, Guernsey = 98, Guinea = 99, GuineaBissau = 100, Guyana = 101, Haiti = 102, HeardAndMcDonaldIslands = 103, Honduras = 104, HongKong = 105, Hungary = 106, Iceland = 107, India = 108, Indonesia = 109, Iran = 110, Iraq = 111, Ireland = 112, IsleOfMan = 113, Israel = 114, Italy = 115, Jamaica = 116, Japan = 117, Jersey = 118, Jordan = 119, Kazakhstan = 120, Kenya = 121, Kiribati = 122, Kosovo = 123, Kuwait = 124, Kyrgyzstan = 125, Laos = 126, Latvia = 127, Lebanon = 128, Lesotho = 129, Liberia = 130, Libya = 131, Liechtenstein = 132, Lithuania = 133, Luxembourg = 134, Macao = 135, Madagascar = 136, Malawi = 137, Malaysia = 138, Maldives = 139, Mali = 140, Malta = 141, MarshallIslands = 142, Martinique = 143, Mauritania = 144, Mauritius = 145, Mayotte = 146, Mexico = 147, Micronesia = 148, Moldova = 149, Monaco = 150, Mongolia = 151, Montenegro = 152, Montserrat = 153, Morocco = 154, Mozambique = 155, Myanmar = 156, Namibia = 157, Nauru = 158, Nepal = 159, Netherlands = 160, NewCaledonia = 161, NewZealand = 162, Nicaragua = 163, Niger = 164, Nigeria = 165, Niue = 166, NorfolkIsland = 167, NorthKorea = 168, NorthMacedonia = 169, NorthernMarianaIslands = 170, Norway = 171, Oman = 172, Pakistan = 173, Palau = 174, Palestine = 175, Panama = 176, PapuaNewGuinea = 177, Paraguay = 178, Peru = 179, Philippines = 180, PitcairnIslands = 181, Poland = 182, Portugal = 183, PuertoRico = 184, Qatar = 185, Romania = 186, Russia = 187, Rwanda = 188, Reunion = 189, Samoa = 190, SanMarino = 191, SaudiArabia = 192, Senegal = 193, Serbia = 194, Seychelles = 195, SierraLeone = 196, Singapore = 197, SintMaarten = 198, Slovakia = 199, Slovenia = 200, SolomonIslands = 201, Somalia = 202, SouthAfrica = 203, SouthGeorgiaAndTheSouthSandwichIslands = 204, SouthKorea = 205, SouthSudan = 206, Spain = 207, SriLanka = 208, StBarthelemy = 209, StHelena = 210, StKittsAndNevis = 211, StLucia = 212, StMartin = 213, StPierreAndMiquelon = 214, StVincentAndGrenadines = 215, Sudan = 216, Suriname = 217, SvalbardAndJanMayen = 218, Sweden = 219, Switzerland = 220, Syria = 221, SaoTomeAndPrincipe = 222, Taiwan = 223, Tajikistan = 224, Tanzania = 225, Thailand = 226, TimorLeste = 227, Togo = 228, Tokelau = 229, Tonga = 230, TrinidadAndTobago = 231, TristanDaCunha = 232, Tunisia = 233, Turkey = 234, Turkmenistan = 235, TurksAndCaicosIslands = 236, Tuvalu = 237, USOutlyingIslands = 238, USVirginIslands = 239, Uganda = 240, Ukraine = 241, UnitedArabEmirates = 242, UnitedKingdom = 243, UnitedStates = 244, Uruguay = 245, Uzbekistan = 246, Vanuatu = 247, VaticanCity = 248, Venezuela = 249, Vietnam = 250, WallisAndFutuna = 251, WesternSahara = 252, Yemen = 253, Zambia = 254, Zimbabwe = 255,
}
Expand description

Specifies the region bias.

§Region Biasing

You can set the Directions service to return results from a specific region by using the region parameter. This parameter takes a ccTLD (country code top-level domain) argument specifying the region bias. Most ccTLD codes are identical to ISO 3166-1 codes, with some notable exceptions. For example, the United Kingdom’s ccTLD is “uk” (.co.uk) while its ISO 3166-1 code is “gb” (technically for the entity of “The United Kingdom of Great Britain and Northern Ireland”).

You may utilize any domain in which the main Google Maps application has launched driving directions.

For example, a directions request for “Toledo” to “Madrid” returns appropriate results when region is set to es and “Toledo” is then interpreted as the Spanish city:

https://maps.googleapis.com/maps/api/directions/json?
origin=Toledo&destination=Madrid
&region=es
&key=YOUR_API_KEY

{
    "status": "OK",
    "routes": [ {
        "summary": "AP-41",
        "legs": [ {
            ...
        } ],
        "copyrights": "Map data ©2010 Europa Technologies, Tele Atlas",
        "warnings": [ ],
        "waypoint_order": [ ]
    } ]
}

A directions request for “Toledo” to “Madrid” sent without a region parameter does not return results, because “Toledo” is interpreted as the city in Ohio and not Spain:

https://maps.googleapis.com/maps/api/directions/json?
origin=Toledo&destination=Madrid
&key=YOUR_API_KEY

{
    "status": "ZERO_RESULTS",
    "routes": [ ]
}

§Map Coverage Details

The Google Maps team is constantly working to improve our international coverage. Some data, such as public transit routes, are available at a city level and do not appear in this list. Please note that data coverage can change if licensing agreements with the data providers change.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

AlandIslands = 0

§

Afghanistan = 1

§

Albania = 2

§

Algeria = 3

§

AmericanSamoa = 4

§

Andorra = 5

§

Angola = 6

§

Anguilla = 7

§

Antarctica = 8

§

AntiguaAndBarbuda = 9

§

Argentina = 10

§

Armenia = 11

§

Aruba = 12

§

AscensionIsland = 13

§

Australia = 14

§

Austria = 15

§

Azerbaijan = 16

§

Bahamas = 17

§

Bahrain = 18

§

Bangladesh = 19

§

Barbados = 20

§

Belarus = 21

§

Belgium = 22

§

Belize = 23

§

Benin = 24

§

Bermuda = 25

§

Bhutan = 26

§

Bolivia = 27

§

BosniaAndHerzegovina = 28

§

Botswana = 29

§

BouvetIsland = 30

§

Brazil = 31

§

BritishIndianOceanTerritory = 32

§

BritishVirginIslands = 33

§

Brunei = 34

§

Bulgaria = 35

§

BurkinaFaso = 36

§

Burundi = 37

§

Cambodia = 38

§

Cameroon = 39

§

Canada = 40

§

CanaryIslands = 41

§

CapeVerde = 42

§

CaribbeanNetherlands = 43

§

CaymanIslands = 44

§

CentralAfricanRepublic = 45

§

CeutaAndMelilla = 46

§

Chad = 47

§

Chile = 48

§

China = 49

§

ChristmasIsland = 50

§

ClippertonIsland = 51

§

CocosKeelingIslands = 52

§

Colombia = 53

§

Comoros = 54

§

CongoBrazzaville = 55

§

CongoKinshasa = 56

§

CookIslands = 57

§

CostaRica = 58

§

CotedIvoire = 59

§

Croatia = 60

§

Cuba = 61

§

Curacao = 62

§

Cyprus = 63

§

Czechia = 64

§

Denmark = 65

§

DiegoGarcia = 66

§

Djibouti = 67

§

Dominica = 68

§

DominicanRepublic = 69

§

Ecuador = 70

§

Egypt = 71

§

ElSalvador = 72

§

EquatorialGuinea = 73

§

Eritrea = 74

§

Estonia = 75

§

Eswatini = 76

§

Ethiopia = 77

§

FalklandIslands = 78

§

FaroeIslands = 79

§

Fiji = 80

§

Finland = 81

§

France = 82

§

FrenchGuiana = 83

§

FrenchPolynesia = 84

§

FrenchSouthernTerritories = 85

§

Gabon = 86

§

Gambia = 87

§

Georgia = 88

§

Germany = 89

§

Ghana = 90

§

Gibraltar = 91

§

Greece = 92

§

Greenland = 93

§

Grenada = 94

§

Guadeloupe = 95

§

Guam = 96

§

Guatemala = 97

§

Guernsey = 98

§

Guinea = 99

§

GuineaBissau = 100

§

Guyana = 101

§

Haiti = 102

§

HeardAndMcDonaldIslands = 103

§

Honduras = 104

§

HongKong = 105

§

Hungary = 106

§

Iceland = 107

§

India = 108

§

Indonesia = 109

§

Iran = 110

§

Iraq = 111

§

Ireland = 112

§

IsleOfMan = 113

§

Israel = 114

§

Italy = 115

§

Jamaica = 116

§

Japan = 117

§

Jersey = 118

§

Jordan = 119

§

Kazakhstan = 120

§

Kenya = 121

§

Kiribati = 122

§

Kosovo = 123

§

Kuwait = 124

§

Kyrgyzstan = 125

§

Laos = 126

§

Latvia = 127

§

Lebanon = 128

§

Lesotho = 129

§

Liberia = 130

§

Libya = 131

§

Liechtenstein = 132

§

Lithuania = 133

§

Luxembourg = 134

§

Macao = 135

§

Madagascar = 136

§

Malawi = 137

§

Malaysia = 138

§

Maldives = 139

§

Mali = 140

§

Malta = 141

§

MarshallIslands = 142

§

Martinique = 143

§

Mauritania = 144

§

Mauritius = 145

§

Mayotte = 146

§

Mexico = 147

§

Micronesia = 148

§

Moldova = 149

§

Monaco = 150

§

Mongolia = 151

§

Montenegro = 152

§

Montserrat = 153

§

Morocco = 154

§

Mozambique = 155

§

Myanmar = 156

§

Namibia = 157

§

Nauru = 158

§

Nepal = 159

§

Netherlands = 160

§

NewCaledonia = 161

§

NewZealand = 162

§

Nicaragua = 163

§

Niger = 164

§

Nigeria = 165

§

Niue = 166

§

NorfolkIsland = 167

§

NorthKorea = 168

§

NorthMacedonia = 169

§

NorthernMarianaIslands = 170

§

Norway = 171

§

Oman = 172

§

Pakistan = 173

§

Palau = 174

§

Palestine = 175

§

Panama = 176

§

PapuaNewGuinea = 177

§

Paraguay = 178

§

Peru = 179

§

Philippines = 180

§

PitcairnIslands = 181

§

Poland = 182

§

Portugal = 183

§

PuertoRico = 184

§

Qatar = 185

§

Romania = 186

§

Russia = 187

§

Rwanda = 188

§

Reunion = 189

§

Samoa = 190

§

SanMarino = 191

§

SaudiArabia = 192

§

Senegal = 193

§

Serbia = 194

§

Seychelles = 195

§

SierraLeone = 196

§

Singapore = 197

§

SintMaarten = 198

§

Slovakia = 199

§

Slovenia = 200

§

SolomonIslands = 201

§

Somalia = 202

§

SouthAfrica = 203

§

SouthGeorgiaAndTheSouthSandwichIslands = 204

§

SouthKorea = 205

§

SouthSudan = 206

§

Spain = 207

§

SriLanka = 208

§

StBarthelemy = 209

§

StHelena = 210

§

StKittsAndNevis = 211

§

StLucia = 212

§

StMartin = 213

§

StPierreAndMiquelon = 214

§

StVincentAndGrenadines = 215

§

Sudan = 216

§

Suriname = 217

§

SvalbardAndJanMayen = 218

§

Sweden = 219

§

Switzerland = 220

§

Syria = 221

§

SaoTomeAndPrincipe = 222

§

Taiwan = 223

§

Tajikistan = 224

§

Tanzania = 225

§

Thailand = 226

§

TimorLeste = 227

§

Togo = 228

§

Tokelau = 229

§

Tonga = 230

§

TrinidadAndTobago = 231

§

TristanDaCunha = 232

§

Tunisia = 233

§

Turkey = 234

§

Turkmenistan = 235

§

TurksAndCaicosIslands = 236

§

Tuvalu = 237

§

USOutlyingIslands = 238

§

USVirginIslands = 239

§

Uganda = 240

§

Ukraine = 241

§

UnitedArabEmirates = 242

§

UnitedKingdom = 243

§

UnitedStates = 244

§

Uruguay = 245

§

Uzbekistan = 246

§

Vanuatu = 247

§

VaticanCity = 248

§

Venezuela = 249

§

Vietnam = 250

§

WallisAndFutuna = 251

§

WesternSahara = 252

§

Yemen = 253

§

Zambia = 254

§

Zimbabwe = 255

Implementations§

source§

impl Region

source

pub const fn display(&self) -> &str

Formats a Region enum into a string that is presentable to the end user.

Trait Implementations§

source§

impl Clone for Region

source§

fn clone(&self) -> Region

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Region

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Region

source§

fn default() -> Region

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Region

source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Manual implementation of Deserialize for serde. This will take advantage of the phf-powered TryFrom implementation for this type.

source§

impl Display for Region

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Converts a Region enum to a String that contains a region code.

source§

impl From<&Region> for &str

source§

fn from(region: &Region) -> Self

Converts a Region enum to a String that contains a region code.

source§

impl From<&Region> for String

source§

fn from(region: &Region) -> Self

Converts a Region enum to a String that contains a region code.

source§

impl FromStr for Region

source§

fn from_str(region_code: &str) -> Result<Self, Self::Err>

Gets a Region enum from a String that contains a supported region code.

§

type Err = Error

The associated error which can be returned from parsing.
source§

impl Hash for Region

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for Region

source§

fn cmp(&self, other: &Region) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Region

source§

fn eq(&self, other: &Region) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Region

source§

fn partial_cmp(&self, other: &Region) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for Region

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Manual implementation of Serialize for serde.

source§

impl TryFrom<&str> for Region

source§

fn try_from(region_code: &str) -> Result<Self, Self::Error>

Gets a Region enum from a String that contains a supported region code.

§

type Error = Error

The type returned in the event of a conversion error.
source§

impl Copy for Region

source§

impl Eq for Region

source§

impl StructuralPartialEq for Region

Auto Trait Implementations§

§

impl Freeze for Region

§

impl RefUnwindSafe for Region

§

impl Send for Region

§

impl Sync for Region

§

impl Unpin for Region

§

impl UnwindSafe for Region

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,