Region

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

Source

pub fn all() -> impl Iterator<Item = (Region, RegionDetails<'static>)>

Iterate over all known regions.

Trait Implementations§

Source§

impl Clone for Region

Source§

fn clone(&self) -> Region

Returns a duplicate 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

Source§

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

Source§

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) -> 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,

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

impl PartialEq for Region

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

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

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

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

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

Source§

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 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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§

fn to_string(&self) -> String

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

impl<T> ToStringFallible for T
where T: Display,

Source§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

Source§

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

Source§

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>,

Source§

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>,