Numeric

Enum Numeric 

Source
#[repr(u16)]
pub enum Numeric {
Show 248 variants Afghanistan = 4, Albania = 8, Antarctica = 10, Algeria = 12, AmericanSamoa = 16, Andorra = 20, Angola = 24, AntiguaAndBarbuda = 28, Azerbaijan = 31, Argentina = 32, Australia = 36, Austria = 40, Bahamas = 44, Bahrain = 48, Bangladesh = 50, Armenia = 51, Barbados = 52, Belgium = 56, Bermuda = 60, Bhutan = 64, Bolivia = 68, BosniaAndHerzegovina = 70, Botswana = 72, BouvetIsland = 74, Brazil = 76, Belize = 84, BritishIndianOceanTerritory = 86, SolomonIslands = 90, BritishVirginIslands = 92, BruneiDarussalam = 96, Bulgaria = 100, Myanmar = 104, Burundi = 108, Belarus = 112, Cambodia = 116, Cameroon = 120, Canada = 124, CaboVerde = 132, CaymanIslands = 136, CentralAfricanRepublic = 140, SriLanka = 144, Chad = 148, Chile = 152, China = 156, ChristmasIsland = 162, CocosKeelingIslands = 166, Colombia = 170, Comoros = 174, Mayotte = 175, Congo = 178, DemocraticRepublicOfTheCongo = 180, CookIslands = 184, CostaRica = 188, Croatia = 191, Cuba = 192, Cyprus = 196, Czechia = 203, Benin = 204, Denmark = 208, Dominica = 212, DominicanRepublic = 214, Ecuador = 218, ElSalvador = 222, EquatorialGuinea = 226, Ethiopia = 231, Eritrea = 232, Estonia = 233, FaroeIslands = 234, FalklandIslands = 238, SouthGeorgiaAndTheSouthSandwichIslands = 239, Fiji = 242, Finland = 246, ÅlandIslands = 248, France = 250, FrenchGuiana = 254, FrenchPolynesia = 258, FrenchSouthernTerritories = 260, Djibouti = 262, Gabon = 266, Georgia = 268, Gambia = 270, Palestine = 275, Germany = 276, Ghana = 288, Gibraltar = 292, Kiribati = 296, Greece = 300, Greenland = 304, Grenada = 308, Guadeloupe = 312, Guam = 316, Guatemala = 320, Guinea = 324, Guyana = 328, Haiti = 332, HeardIslandAndMcDonaldIslands = 334, HolySee = 336, Honduras = 340, HongKong = 344, Hungary = 348, Iceland = 352, India = 356, Indonesia = 360, Iran = 364, Iraq = 368, Ireland = 372, Israel = 376, Italy = 380, CôteDIvoire = 384, Jamaica = 388, Japan = 392, Kazakhstan = 398, Jordan = 400, Kenya = 404, NorthKorea = 408, SouthKorea = 410, Kuwait = 414, Kyrgyzstan = 417, Laos = 418, Lebanon = 422, Lesotho = 426, Latvia = 428, Liberia = 430, Libya = 434, Liechtenstein = 438, Lithuania = 440, Luxembourg = 442, Macao = 446, Madagascar = 450, Malawi = 454, Malaysia = 458, Maldives = 462, Mali = 466, Malta = 470, Martinique = 474, Mauritania = 478, Mauritius = 480, Mexico = 484, Monaco = 492, Mongolia = 496, Moldova = 498, Montenegro = 499, Montserrat = 500, Morocco = 504, Mozambique = 508, Oman = 512, Namibia = 516, Nauru = 520, Nepal = 524, Netherlands = 528, Curaçao = 531, Aruba = 533, DutchSaintMartin = 534, BonaireSintEustatiusAndSaba = 535, NewCaledonia = 540, Vanuatu = 548, NewZealand = 554, Nicaragua = 558, Niger = 562, Nigeria = 566, Niue = 570, NorfolkIsland = 574, Norway = 578, NorthernMarianaIslands = 580, UnitedStatesMinorOutlyingIslands = 581, Micronesia = 583, MarshallIslands = 584, Palau = 585, Pakistan = 586, Panama = 591, PapuaNewGuinea = 598, Paraguay = 600, Peru = 604, Philippines = 608, Pitcairn = 612, Poland = 616, Portugal = 620, GuineaBissau = 624, TimorLeste = 626, PuertoRico = 630, Qatar = 634, Réunion = 638, Romania = 642, Russia = 643, Rwanda = 646, SaintBarthélemy = 652, SaintHelena = 654, SaintKittsAndNevis = 659, Anguilla = 660, SaintLucia = 662, FrenchSaintMartin = 663, SaintPierreAndMiquelon = 666, SaintVincentAndTheGrenadines = 670, SanMarino = 674, SaoTomeAndPrincipe = 678, SaudiArabia = 682, Senegal = 686, Serbia = 688, Seychelles = 690, SierraLeone = 694, Singapore = 702, Slovakia = 703, VietNam = 704, Slovenia = 705, Somalia = 706, SouthAfrica = 710, Zimbabwe = 716, Spain = 724, SouthSudan = 728, Sudan = 729, WesternSahara = 732, Suriname = 740, SvalbardAndJanMayenIslands = 744, Eswatini = 748, Sweden = 752, Switzerland = 756, Syria = 760, Tajikistan = 762, Thailand = 764, Togo = 768, Tokelau = 772, Tonga = 776, TrinidadAndTobago = 780, UnitedArabEmirates = 784, Tunisia = 788, Türkiye = 792, Turkmenistan = 795, TurksAndCaicosIslands = 796, Tuvalu = 798, Uganda = 800, Ukraine = 804, NorthMacedonia = 807, Egypt = 818, UnitedKingdom = 826, Guernsey = 831, Jersey = 832, IsleOfMan = 833, Tanzania = 834, UnitedStatesOfAmerica = 840, UnitedStatesVirginIslands = 850, BurkinaFaso = 854, Uruguay = 858, Uzbekistan = 860, Venezuela = 862, WallisAndFutunaIslands = 876, Samoa = 882, Yemen = 887, Zambia = 894,
}
Expand description

ISO 3166-1 numeric country codes.

When the serde feature is enabled, this code will be serialized as a 16-bit unsigned integer.

§Examples

use core::str::FromStr;
use iso3166_static::Numeric;

let alpha2 = Numeric::from_alpha2("US").expect("alpha2");
let alpha3 = Numeric::from_alpha3("USA").expect("alpha3");
let fromstr = Numeric::from_str("   uS ").expect("fromstr");

assert_eq!(alpha2, alpha3);
assert_eq!(alpha3, fromstr);

Some failure conditions:

use core::str::FromStr;
use iso3166_static::{Error, Numeric};

let badcode = Numeric::from_u16(12345).expect_err("not a code");
assert_eq!(Error::UnknownCode, badcode);

let lower2 = Numeric::from_alpha2("us").expect_err("not uppercase");
assert_eq!(Error::UnknownString, lower2);

let mixed3 = Numeric::from_alpha3("uSa").expect_err("not uppercase");
assert_eq!(Error::UnknownString, mixed3);

let too_long = Numeric::from_str("asdf").expect_err("not a code");
assert_eq!(Error::InvalidLength, too_long);

Variants§

§

Afghanistan = 4

Afghanistan

§

Albania = 8

Albania

§

Antarctica = 10

Antarctica

§

Algeria = 12

Algeria

§

AmericanSamoa = 16

American Samoa

§

Andorra = 20

Andorra

§

Angola = 24

Angola

§

AntiguaAndBarbuda = 28

Antigua and Barbuda

§

Azerbaijan = 31

Azerbaijan

§

Argentina = 32

Argentina

§

Australia = 36

Australia

§

Austria = 40

Austria

§

Bahamas = 44

Bahamas

§

Bahrain = 48

Bahrain

§

Bangladesh = 50

Bangladesh

§

Armenia = 51

Armenia

§

Barbados = 52

Barbados

§

Belgium = 56

Belgium

§

Bermuda = 60

Bermuda

§

Bhutan = 64

Bhutan

§

Bolivia = 68

Bolivia (Plurinational State of)

§

BosniaAndHerzegovina = 70

Bosnia and Herzegovina

§

Botswana = 72

Botswana

§

BouvetIsland = 74

Bouvet Island

§

Brazil = 76

Brazil

§

Belize = 84

Belize

§

BritishIndianOceanTerritory = 86

British Indian Ocean Territory

§

SolomonIslands = 90

Solomon Islands

§

BritishVirginIslands = 92

British Virgin Islands

§

BruneiDarussalam = 96

Brunei Darussalam

§

Bulgaria = 100

Bulgaria

§

Myanmar = 104

Myanmar

§

Burundi = 108

Burundi

§

Belarus = 112

Belarus

§

Cambodia = 116

Cambodia

§

Cameroon = 120

Cameroon

§

Canada = 124

Canada

§

CaboVerde = 132

Cabo Verde

§

CaymanIslands = 136

Cayman Islands

§

CentralAfricanRepublic = 140

Central African Republic

§

SriLanka = 144

Sri Lanka

§

Chad = 148

Chad

§

Chile = 152

Chile

§

China = 156

China

§

ChristmasIsland = 162

Christmas Island

§

CocosKeelingIslands = 166

Cocos (Keeling) Islands

§

Colombia = 170

Colombia

§

Comoros = 174

Comoros

§

Mayotte = 175

Mayotte

§

Congo = 178

Congo

§

DemocraticRepublicOfTheCongo = 180

Democratic Republic of the Congo

§

CookIslands = 184

Cook Islands

§

CostaRica = 188

Costa Rica

§

Croatia = 191

Croatia

§

Cuba = 192

Cuba

§

Cyprus = 196

Cyprus

§

Czechia = 203

Czechia

§

Benin = 204

Benin

§

Denmark = 208

Denmark

§

Dominica = 212

Dominica

§

DominicanRepublic = 214

Dominican Republic

§

Ecuador = 218

Ecuador

§

ElSalvador = 222

El Salvador

§

EquatorialGuinea = 226

Equatorial Guinea

§

Ethiopia = 231

Ethiopia

§

Eritrea = 232

Eritrea

§

Estonia = 233

Estonia

§

FaroeIslands = 234

Faroe Islands

§

FalklandIslands = 238

Falkland Islands (Malvinas)

§

SouthGeorgiaAndTheSouthSandwichIslands = 239

South Georgia and the South Sandwich Islands

§

Fiji = 242

Fiji

§

Finland = 246

Finland

§

ÅlandIslands = 248

Åland Islands

§

France = 250

France

§

FrenchGuiana = 254

French Guiana

§

FrenchPolynesia = 258

French Polynesia

§

FrenchSouthernTerritories = 260

French Southern Territories

§

Djibouti = 262

Djibouti

§

Gabon = 266

Gabon

§

Georgia = 268

Georgia

§

Gambia = 270

Gambia

§

Palestine = 275

State of Palestine

§

Germany = 276

Germany

§

Ghana = 288

Ghana

§

Gibraltar = 292

Gibraltar

§

Kiribati = 296

Kiribati

§

Greece = 300

Greece

§

Greenland = 304

Greenland

§

Grenada = 308

Grenada

§

Guadeloupe = 312

Guadeloupe

§

Guam = 316

Guam

§

Guatemala = 320

Guatemala

§

Guinea = 324

Guinea

§

Guyana = 328

Guyana

§

Haiti = 332

Haiti

§

HeardIslandAndMcDonaldIslands = 334

Heard Island and McDonald Islands

§

HolySee = 336

Holy See

§

Honduras = 340

Honduras

§

HongKong = 344

China, Hong Kong Special Administrative Region

§

Hungary = 348

Hungary

§

Iceland = 352

Iceland

§

India = 356

India

§

Indonesia = 360

Indonesia

§

Iran = 364

Iran (Islamic Republic of)

§

Iraq = 368

Iraq

§

Ireland = 372

Ireland

§

Israel = 376

Israel

§

Italy = 380

Italy

§

CôteDIvoire = 384

Côte d’Ivoire

§

Jamaica = 388

Jamaica

§

Japan = 392

Japan

§

Kazakhstan = 398

Kazakhstan

§

Jordan = 400

Jordan

§

Kenya = 404

Kenya

§

NorthKorea = 408

Democratic People’s Republic of Korea

§

SouthKorea = 410

Republic of Korea

§

Kuwait = 414

Kuwait

§

Kyrgyzstan = 417

Kyrgyzstan

§

Laos = 418

Lao People’s Democratic Republic

§

Lebanon = 422

Lebanon

§

Lesotho = 426

Lesotho

§

Latvia = 428

Latvia

§

Liberia = 430

Liberia

§

Libya = 434

Libya

§

Liechtenstein = 438

Liechtenstein

§

Lithuania = 440

Lithuania

§

Luxembourg = 442

Luxembourg

§

Macao = 446

China, Macao Special Administrative Region

§

Madagascar = 450

Madagascar

§

Malawi = 454

Malawi

§

Malaysia = 458

Malaysia

§

Maldives = 462

Maldives

§

Mali = 466

Mali

§

Malta = 470

Malta

§

Martinique = 474

Martinique

§

Mauritania = 478

Mauritania

§

Mauritius = 480

Mauritius

§

Mexico = 484

Mexico

§

Monaco = 492

Monaco

§

Mongolia = 496

Mongolia

§

Moldova = 498

Republic of Moldova

§

Montenegro = 499

Montenegro

§

Montserrat = 500

Montserrat

§

Morocco = 504

Morocco

§

Mozambique = 508

Mozambique

§

Oman = 512

Oman

§

Namibia = 516

Namibia

§

Nauru = 520

Nauru

§

Nepal = 524

Nepal

§

Netherlands = 528

Netherlands (Kingdom of the)

§

Curaçao = 531

Curaçao

§

Aruba = 533

Aruba

§

DutchSaintMartin = 534

Sint Maarten (Dutch part)

§

BonaireSintEustatiusAndSaba = 535

Bonaire, Sint Eustatius and Saba

§

NewCaledonia = 540

New Caledonia

§

Vanuatu = 548

Vanuatu

§

NewZealand = 554

New Zealand

§

Nicaragua = 558

Nicaragua

§

Niger = 562

Niger

§

Nigeria = 566

Nigeria

§

Niue = 570

Niue

§

NorfolkIsland = 574

Norfolk Island

§

Norway = 578

Norway

§

NorthernMarianaIslands = 580

Northern Mariana Islands

§

UnitedStatesMinorOutlyingIslands = 581

United States Minor Outlying Islands

§

Micronesia = 583

Micronesia (Federated States of)

§

MarshallIslands = 584

Marshall Islands

§

Palau = 585

Palau

§

Pakistan = 586

Pakistan

§

Panama = 591

Panama

§

PapuaNewGuinea = 598

Papua New Guinea

§

Paraguay = 600

Paraguay

§

Peru = 604

Peru

§

Philippines = 608

Philippines

§

Pitcairn = 612

Pitcairn

§

Poland = 616

Poland

§

Portugal = 620

Portugal

§

GuineaBissau = 624

Guinea-Bissau

§

TimorLeste = 626

Timor-Leste

§

PuertoRico = 630

Puerto Rico

§

Qatar = 634

Qatar

§

Réunion = 638

Réunion

§

Romania = 642

Romania

§

Russia = 643

Russian Federation

§

Rwanda = 646

Rwanda

§

SaintBarthélemy = 652

Saint Barthélemy

§

SaintHelena = 654

Saint Helena

§

SaintKittsAndNevis = 659

Saint Kitts and Nevis

§

Anguilla = 660

Anguilla

§

SaintLucia = 662

Saint Lucia

§

FrenchSaintMartin = 663

Saint Martin (French Part)

§

SaintPierreAndMiquelon = 666

Saint Pierre and Miquelon

§

SaintVincentAndTheGrenadines = 670

Saint Vincent and the Grenadines

§

SanMarino = 674

San Marino

§

SaoTomeAndPrincipe = 678

Sao Tome and Principe

§

SaudiArabia = 682

Saudi Arabia

§

Senegal = 686

Senegal

§

Serbia = 688

Serbia

§

Seychelles = 690

Seychelles

§

SierraLeone = 694

Sierra Leone

§

Singapore = 702

Singapore

§

Slovakia = 703

Slovakia

§

VietNam = 704

Viet Nam

§

Slovenia = 705

Slovenia

§

Somalia = 706

Somalia

§

SouthAfrica = 710

South Africa

§

Zimbabwe = 716

Zimbabwe

§

Spain = 724

Spain

§

SouthSudan = 728

South Sudan

§

Sudan = 729

Sudan

§

WesternSahara = 732

Western Sahara

§

Suriname = 740

Suriname

§

SvalbardAndJanMayenIslands = 744

Svalbard and Jan Mayen Islands

§

Eswatini = 748

Eswatini

§

Sweden = 752

Sweden

§

Switzerland = 756

Switzerland

§

Syria = 760

Syrian Arab Republic

§

Tajikistan = 762

Tajikistan

§

Thailand = 764

Thailand

§

Togo = 768

Togo

§

Tokelau = 772

Tokelau

§

Tonga = 776

Tonga

§

TrinidadAndTobago = 780

Trinidad and Tobago

§

UnitedArabEmirates = 784

United Arab Emirates

§

Tunisia = 788

Tunisia

§

Türkiye = 792

Türkiye

§

Turkmenistan = 795

Turkmenistan

§

TurksAndCaicosIslands = 796

Turks and Caicos Islands

§

Tuvalu = 798

Tuvalu

§

Uganda = 800

Uganda

§

Ukraine = 804

Ukraine

§

NorthMacedonia = 807

North Macedonia

§

Egypt = 818

Egypt

§

UnitedKingdom = 826

United Kingdom of Great Britain and Northern Ireland

§

Guernsey = 831

Guernsey

§

Jersey = 832

Jersey

§

IsleOfMan = 833

Isle of Man

§

Tanzania = 834

United Republic of Tanzania

§

UnitedStatesOfAmerica = 840

United States of America

§

UnitedStatesVirginIslands = 850

United States Virgin Islands

§

BurkinaFaso = 854

Burkina Faso

§

Uruguay = 858

Uruguay

§

Uzbekistan = 860

Uzbekistan

§

Venezuela = 862

Venezuela (Bolivarian Republic of)

§

WallisAndFutunaIslands = 876

Wallis and Futuna Islands

§

Samoa = 882

Samoa

§

Yemen = 887

Yemen

§

Zambia = 894

Zambia

Implementations§

Source§

impl Numeric

Source

pub const fn from_alpha2(s: &str) -> Result<Self, Error>

Create a new country code enum value from the given Alpah2 code string.

Source

pub const fn from_alpha3(s: &str) -> Result<Self, Error>

Create a new country code enum value from the given Alpah3 code string.

Source

pub const fn from_u16(value: u16) -> Result<Self, Error>

Create a new country enum from the given u16 value.

Source

pub const fn as_alpha2_str(&self) -> &'static str

Get the Alpha2 code as an uppercase 2-character static string

Source

pub const fn as_alpha3_str(&self) -> &'static str

Get the Alpha3 country code as an uppercase static 3-character string

Source

pub const fn as_u16(&self) -> u16

Convert this value to a u16

Source§

impl Numeric

Source

pub const fn from_str_slice(s: &str) -> Result<Self, Error>

Create a new value the given string.

This method will accept strings with 2-3 consecutive ASCII alphabetic characters left- or right-padded by ASCII whitespace. The strings in question don’t need to be in a particular case. This is used by the FromStr implementation.

§Errors

Trait Implementations§

Source§

impl Clone for Numeric

Source§

fn clone(&self) -> Numeric

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 Numeric

Source§

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

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

impl<'de> Deserialize<'de> for Numeric

Available on crate feature serde only.
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 Numeric

Source§

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

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

impl From<Alpha2> for Numeric

Source§

fn from(value: Alpha2) -> Self

Converts to this type from the input type.
Source§

impl From<Alpha3> for Numeric

Source§

fn from(value: Alpha3) -> Self

Converts to this type from the input type.
Source§

impl From<Numeric> for Alpha2

Source§

fn from(value: Numeric) -> Self

Converts to this type from the input type.
Source§

impl From<Numeric> for Alpha3

Source§

fn from(value: Numeric) -> Self

Converts to this type from the input type.
Source§

impl From<Numeric> for u16

Source§

fn from(value: Numeric) -> Self

Converts to this type from the input type.
Source§

impl FromStr for Numeric

Source§

type Err = Error

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 Hash for Numeric

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Numeric

Source§

fn cmp(&self, other: &Numeric) -> 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<Alpha2> for Numeric

Source§

fn eq(&self, other: &Alpha2) -> 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 PartialEq<Alpha3> for Numeric

Source§

fn eq(&self, other: &Alpha3) -> 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 PartialEq<Numeric> for Alpha2

Source§

fn eq(&self, other: &Numeric) -> 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 PartialEq<Numeric> for Alpha3

Source§

fn eq(&self, other: &Numeric) -> 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 PartialEq for Numeric

Source§

fn eq(&self, other: &Numeric) -> 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 Numeric

Source§

fn partial_cmp(&self, other: &Numeric) -> 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 Numeric

Available on crate feature serde only.
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 TryFrom<&str> for Numeric

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(value: &str) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u16> for Numeric

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(value: u16) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Copy for Numeric

Source§

impl Eq for Numeric

Source§

impl StructuralPartialEq for Numeric

Auto Trait Implementations§

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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