pub enum State {
Show 57 variants
Alabama,
Alaska,
Arizona,
Arkansas,
AmericanSomoa,
California,
Colorado,
Connecticut,
Delaware,
DistrictOfColumbia,
Florida,
Georgia,
Guam,
Hawaii,
Idaho,
Illinois,
Indiana,
Iowa,
Kansas,
Kentucky,
Louisiana,
Maine,
Maryland,
Massachusetts,
Michigan,
Minnesota,
Mississippi,
Missouri,
Montana,
Nebraska,
Nevada,
NewHampshire,
NewJersey,
NewMexico,
NewYork,
NorthCarolina,
NorthDakota,
NorthernMarianaIslands,
Ohio,
Oklahoma,
Oregon,
Pennsylvania,
PuertoRico,
RhodeIsland,
SouthCarolina,
SouthDakota,
Tennessee,
Texas,
TrustTerritories,
Utah,
Vermont,
Virginia,
VirginIslands,
Washington,
WestVirginia,
Wisconsin,
Wyoming,
}Expand description
The State enum holds variants for state and territory names in the US used by the FAA.
https://www.faa.gov/air_traffic/publications/atpubs/cnt_html/appendix_a.html
Variants§
Alabama
Alaska
Arizona
Arkansas
AmericanSomoa
California
Colorado
Connecticut
Delaware
DistrictOfColumbia
Florida
Georgia
Guam
Hawaii
Idaho
Illinois
Indiana
Iowa
Kansas
Kentucky
Louisiana
Maine
Maryland
Massachusetts
Michigan
Minnesota
Mississippi
Missouri
Montana
Nebraska
Nevada
NewHampshire
NewJersey
NewMexico
NewYork
NorthCarolina
NorthDakota
NorthernMarianaIslands
Ohio
Oklahoma
Oregon
Pennsylvania
PuertoRico
RhodeIsland
SouthCarolina
SouthDakota
Tennessee
Texas
TrustTerritories
Utah
Vermont
Virginia
VirginIslands
Washington
WestVirginia
Wisconsin
Wyoming
Implementations§
Source§impl State
impl State
Sourcepub fn abbreviate(&self) -> String
pub fn abbreviate(&self) -> String
The abbreviate method returns the two-character standard postal abbreviation for a state
or territory.
Sourcepub fn match_abbreviated(input: &str) -> Option<Self>
pub fn match_abbreviated(input: &str) -> Option<Self>
The match_abbreviated method matches the input str against valid abbreviations for a US
state or territory.
Sourcepub fn match_mixed(input: &str) -> Option<Self>
pub fn match_mixed(input: &str) -> Option<Self>
The match_mixed method attempts to convert the str in input to a variant of the
State enum. As we encounter additional mappings of non-standard spellings to valid variants, we add them to the match statement here.
Sourcepub fn deserialize_mixed<'de, D: Deserializer<'de>>(
de: D,
) -> Result<Self, D::Error>
pub fn deserialize_mixed<'de, D: Deserializer<'de>>( de: D, ) -> Result<Self, D::Error>
The deserialize_abbreviated method attempts to convert an input from the postal
abbreviation for a US state or territory to a variant of the State enum.
Use this method when the input field for state is not sanitized and failure to map to a variant
is an acceptable or anticipated outcome.
TODO: Eliminate unwrap.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for State
impl<'de> Deserialize<'de> for State
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>,
Source§impl Ord for State
impl Ord for State
Source§impl PartialOrd for State
impl PartialOrd for State
impl Copy for State
impl Eq for State
impl StructuralPartialEq for State
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more