pub struct Geoname {
pub geoname_id: i64,
pub geoname_type: GeonameType,
pub name: String,
pub country_code: String,
pub feature_class: String,
pub feature_code: String,
pub admin_division_codes: HashMap<u8, String>,
pub population: u64,
pub latitude: String,
pub longitude: String,
}
Expand description
A single geographic place.
This corresponds to a single row in the main “geoname” table described in the GeoNames documentation 1. We exclude fields we don’t need.
Fields§
§geoname_id: i64
The geonameid
straight from the geoname table.
geoname_type: GeonameType
The geoname type. This is derived from feature_class
and
feature_code
as a more convenient representation of the type.
name: String
The place’s primary name.
country_code: String
ISO-3166 two-letter uppercase country code, e.g., “US”.
feature_class: String
Primary geoname category. Examples:
“PCLI” - Independent political entity: country “A” - Administrative division: state, province, borough, district, etc. “P” - Populated place: city, village, etc.
feature_code: String
Secondary geoname category, depends on feature_class
. Examples:
“ADM1” - Administrative division 1 “PPL” - Populated place like a city
admin_division_codes: HashMap<u8, String>
Administrative divisions. This maps admin division levels (1-based) to
their corresponding codes. For example, Liverpool has two admin
divisions: “ENG” at level 1 and “H8” at level 2. They would be
represented in this map with entries (1, "ENG")
and (2, "H8")
.
population: u64
Population size.
latitude: String
Latitude in decimal degrees (as a string).
longitude: String
Longitude in decimal degrees (as a string).
Implementations§
Trait Implementations§
Source§impl<UT> ConvertError<UT> for Geoname
impl<UT> ConvertError<UT> for Geoname
fn try_convert_unexpected_callback_error( e: UnexpectedUniFFICallbackError, ) -> Result<Self>
Source§impl<UT> FfiConverter<UT> for Geoname
impl<UT> FfiConverter<UT> for Geoname
Source§const TYPE_ID_META: MetadataBuffer
const TYPE_ID_META: MetadataBuffer
Source§type FfiType = RustBuffer
type FfiType = RustBuffer
Source§fn lower(v: Self) -> RustBuffer
fn lower(v: Self) -> RustBuffer
Source§fn try_lift(buf: RustBuffer) -> Result<Self>
fn try_lift(buf: RustBuffer) -> Result<Self>
Source§impl<UT> LiftReturn<UT> for Geoname
impl<UT> LiftReturn<UT> for Geoname
Source§type ReturnType = <Geoname as Lift<UT>>::FfiType
type ReturnType = <Geoname as Lift<UT>>::FfiType
Source§fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
§fn lift_foreign_return(
ffi_return: Self::ReturnType,
call_status: RustCallStatus,
) -> Self
fn lift_foreign_return( ffi_return: Self::ReturnType, call_status: RustCallStatus, ) -> Self
§fn lift_error(_buf: RustBuffer) -> Self
fn lift_error(_buf: RustBuffer) -> Self
§fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
Source§impl<UT> LowerError<UT> for Geoname
impl<UT> LowerError<UT> for Geoname
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for Geoname
impl<UT> LowerReturn<UT> for Geoname
Source§type ReturnType = <Geoname as Lower<UT>>::FfiType
type ReturnType = <Geoname as Lower<UT>>::FfiType
Source§fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
impl Eq for Geoname
impl StructuralPartialEq for Geoname
Auto Trait Implementations§
impl Freeze for Geoname
impl RefUnwindSafe for Geoname
impl Send for Geoname
impl Sync for Geoname
impl Unpin for Geoname
impl UnwindSafe for Geoname
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<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
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
Read more