Struct flytrap::RegionCode
source · 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 copy 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§fn eq(&self, other: &RegionCode) -> bool
fn eq(&self, other: &RegionCode) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd for RegionCode
impl PartialOrd for RegionCode
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moresource§impl Serialize for RegionCode
impl Serialize for RegionCode
impl Copy for RegionCode
impl Eq for RegionCode
impl StructuralEq for RegionCode
impl StructuralPartialEq for RegionCode
Auto Trait Implementations§
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