pub struct RegionCode(/* private fields */);Available on crate feature
regions only.Expand description
An unrecognized Fly.io region code.
If Flytrap parses a region code which doesn’t match any of the Region
variants compiled into the crate, the bare value is preserved as a
RegionCode.
use flytrap::{Location, Region};
let cairo: Location = "cai".parse()?;
let tokyo: Location = "nrt".parse()?;
assert_eq!(cairo, Location::Unknown("cai".parse()?));
assert_eq!(tokyo, Location::Region(Region::Tokyo));Implementations§
Source§impl RegionCode
impl RegionCode
Sourcepub const NULL_ISLAND: (R32, R32)
pub const NULL_ISLAND: (R32, R32)
The geographic coordinates for “null island”, a fictitious landform at
0º latitude and longitude. Used as the coordinates for a Location::Unknown.
Trait Implementations§
Source§impl AsRef<[u8]> for RegionCode
impl AsRef<[u8]> for RegionCode
Source§impl AsRef<str> for RegionCode
impl AsRef<str> for RegionCode
Source§impl Clone for RegionCode
impl Clone for RegionCode
Source§fn clone(&self) -> RegionCode
fn clone(&self) -> RegionCode
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RegionCode
impl Debug for RegionCode
Source§impl<'de> Deserialize<'de> for RegionCode
impl<'de> Deserialize<'de> for RegionCode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 RegionCode
impl Display for RegionCode
Source§impl From<Region> for RegionCode
impl From<Region> for RegionCode
Source§impl From<RegionCode> for Location
impl From<RegionCode> for Location
Source§fn from(value: RegionCode) -> Self
fn from(value: RegionCode) -> Self
Converts to this type from the input type.
Source§impl FromStr for RegionCode
impl FromStr for RegionCode
Source§impl Ord for RegionCode
impl Ord for RegionCode
Source§impl PartialEq for RegionCode
impl PartialEq for RegionCode
Source§impl PartialOrd for RegionCode
impl PartialOrd for RegionCode
Source§impl Serialize for RegionCode
impl Serialize for RegionCode
impl Copy for RegionCode
impl Eq for RegionCode
impl StructuralPartialEq for RegionCode
Auto Trait Implementations§
impl Freeze for RegionCode
impl RefUnwindSafe for RegionCode
impl Send for RegionCode
impl Sync for RegionCode
impl Unpin for RegionCode
impl UnwindSafe for RegionCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.