Enum flytrap::Region

source ·
#[repr(u32)]
pub enum Region {
Show 36 variants Amsterdam = 1_634_562_816, Ashburn = 1_767_990_272, Atlanta = 1_635_019_776, Bogota = 1_651_468_032, Boston = 1_651_471_104, Bucharest = 1_869_901_824, Chennai = 1_835_098_368, Chicago = 1_869_767_680, Dallas = 1_684_436_736, Denver = 1_684_368_896, Ezeiza = 1_702_520_064, Frankfurt = 1_718_771_968, Guadalajara = 1_734_634_496, HongKong = 1_751_869_184, Johannesburg = 1_785_618_944, London = 1_818_784_256, LosAngeles = 1_818_327_040, Madrid = 1_835_099_136, Miami = 1_835_622_656, Montreal = 2_037_738_496, Mumbai = 1_651_469_568, Paris = 1_667_524_352, Phoenix = 1_885_894_656, Queretaro = 1_903_324_928, RioDeJaneiro = 1_734_960_896, SanJose = 1_936_352_000, Santiago = 1_935_895_552, SaoPaulo = 1_735_554_304, Seattle = 1_936_023_808, Secaucus = 1_702_326_784, Singapore = 1_936_289_280, Stockholm = 1_634_889_216, Sydney = 1_937_335_296, Tokyo = 1_852_994_560, Toronto = 2_038_004_224, Warsaw = 2_002_876_160,
}
Available on crate feature regions only.
Expand description

A Fly.io region.

Information about the region is available through the associated RegionDetails, including the City where the region is located.

use flytrap::Region;

let chicago: Region = "ord".parse()?;

assert_eq!(chicago.name, "Chicago, Illinois (US)");
assert_eq!(chicago.city.name, "Chicago");
assert_eq!(chicago.city.country, "US");
assert!(chicago.city.geo.x() < Region::Amsterdam.city.geo.x());
assert_eq!(chicago.to_string(), "ord");
assert_eq!(mem::size_of::<Region>(), 4);

Variants§

§

Amsterdam = 1_634_562_816

The Amsterdam, Netherlands Fly.io region (ams).

§

Ashburn = 1_767_990_272

The Ashburn, Virginia (US) Fly.io region (iad).

§

Atlanta = 1_635_019_776

The Atlanta, Georgia (US) Fly.io region (atl).

§

Bogota = 1_651_468_032

The Bogotá, Colombia Fly.io region (bog).

§

Boston = 1_651_471_104

The Boston, Massachusetts (US) Fly.io region (bos).

§

Bucharest = 1_869_901_824

The Bucharest, Romania Fly.io region (otp).

§

Chennai = 1_835_098_368

The Chennai (Madras), India Fly.io region (maa).

§

Chicago = 1_869_767_680

The Chicago, Illinois (US) Fly.io region (ord).

§

Dallas = 1_684_436_736

The Dallas, Texas (US) Fly.io region (dfw).

§

Denver = 1_684_368_896

The Denver, Colorado (US) Fly.io region (den).

§

Ezeiza = 1_702_520_064

The Ezeiza, Argentina Fly.io region (eze).

§

Frankfurt = 1_718_771_968

The Frankfurt, Germany Fly.io region (fra).

§

Guadalajara = 1_734_634_496

The Guadalajara, Mexico Fly.io region (gdl).

§

HongKong = 1_751_869_184

The Hong Kong, Hong Kong Fly.io region (hkg).

§

Johannesburg = 1_785_618_944

The Johannesburg, South Africa Fly.io region (jnb).

§

London = 1_818_784_256

The London, United Kingdom Fly.io region (lhr).

§

LosAngeles = 1_818_327_040

The Los Angeles, California (US) Fly.io region (lax).

§

Madrid = 1_835_099_136

The Madrid, Spain Fly.io region (mad).

§

Miami = 1_835_622_656

The Miami, Florida (US) Fly.io region (mia).

§

Montreal = 2_037_738_496

The Montreal, Canada Fly.io region (yul).

§

Mumbai = 1_651_469_568

The Mumbai, India Fly.io region (bom).

§

Paris = 1_667_524_352

The Paris, France Fly.io region (cdg).

§

Phoenix = 1_885_894_656

The Phoenix, Arizona (US) Fly.io region (phx).

§

Queretaro = 1_903_324_928

The Querétaro, Mexico Fly.io region (qro).

§

RioDeJaneiro = 1_734_960_896

The Rio de Janeiro, Brazil Fly.io region (gig).

§

SanJose = 1_936_352_000

The San Jose, California (US) Fly.io region (sjc).

§

Santiago = 1_935_895_552

The Santiago, Chile Fly.io region (scl).

§

SaoPaulo = 1_735_554_304

The Sao Paulo, Brazil Fly.io region (gru).

§

Seattle = 1_936_023_808

The Seattle, Washington (US) Fly.io region (sea).

§

Secaucus = 1_702_326_784

The Secaucus, NJ (US) Fly.io region (ewr).

§

Singapore = 1_936_289_280

The Singapore, Singapore Fly.io region (sin).

§

Stockholm = 1_634_889_216

The Stockholm, Sweden Fly.io region (arn).

§

Sydney = 1_937_335_296

The Sydney, Australia Fly.io region (syd).

§

Tokyo = 1_852_994_560

The Tokyo, Japan Fly.io region (nrt).

§

Toronto = 2_038_004_224

The Toronto, Canada Fly.io region (yyz).

§

Warsaw = 2_002_876_160

The Warsaw, Poland Fly.io region (waw).

Implementations§

source§

impl Region

source

pub fn details(&self) -> RegionDetails<'static>

The known details of the region.

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<'de> Deserialize<'de> for Region

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for Region

source§

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

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

impl Enum for Region

source§

const LENGTH: usize = 36usize

Length of the enum.
source§

fn from_usize(value: usize) -> Self

Takes an usize, and returns an element matching into_usize function.
source§

fn into_usize(self) -> usize

Returns an unique identifier for a value within range of 0..Array::LENGTH.
source§

impl<V> EnumArray<V> for Region

§

type Array = [V; 36]

Representation of an enum map for type V.
source§

impl From<Region> for Location

source§

fn from(value: Region) -> Self

Converts to this type from the input type.
source§

impl From<Region> for RegionCode

source§

fn from(value: Region) -> Self

Converts to this type from the input type.
source§

impl FromStr for Region

§

type Err = RegionError

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

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

Parses a string s to return a value of this type. Read more
source§

impl Ord for Region

source§

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

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

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

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

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

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

fn clamp(self, min: Self, max: Self) -> Selfwhere 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: &Self) -> 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,

Serialize this value into the given Serde serializer. Read more
source§

impl Deref for Region

§

type Target = RegionDetails<'static>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Copy for Region

source§

impl Eq for Region

source§

impl StructuralEq for Region

source§

impl StructuralPartialEq for Region

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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.

§

impl<T> Instrument for T

§

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

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

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 Twhere 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> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere 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 Twhere 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 Twhere 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 Twhere 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.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

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 Twhere T: for<'de> Deserialize<'de>,