Struct gb2260::Division
[−]
[src]
pub struct Division { pub code: &'static str, pub name: &'static str, pub revision: &'static str, }
The administrative division
Fields
code: &'static str
The six-digit number of the specific administrative division
name: &'static str
The Chinese name of the specific administrative division
revision: &'static str
The revision year (month)
Methods
impl Division
[src]
pub fn get(code: &str) -> Option<Self>
[src]
Return the division of the given code
pub fn get_by_revision(code: &str, revision: &str) -> Option<Self>
[src]
Return the division of the given code of the given revision
pub fn revisions() -> Vec<&'static str>
[src]
List all revisions supported by GB2260
pub fn province(&self) -> Self
[src]
Return province level division of current division
pub fn is_province(&self) -> bool
[src]
pub fn prefecture(&self) -> Option<Self>
[src]
Return prefecture level division of current division
pub fn is_prefecture(&self) -> bool
[src]
pub fn county(&self) -> Option<&Division>
[src]
Return county level division of current division
pub fn is_county(&self) -> bool
[src]
Trait Implementations
impl Debug for Division
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for Division
[src]
fn clone(&self) -> Division
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for Division
[src]
fn eq(&self, __arg_0: &Division) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Division) -> bool
[src]
This method tests for !=
.