pub struct IndexData {
pub entries: Vec<Entry>,
pub geonames: HashMap<u32, CitiesRecord>,
pub capitals: HashMap<String, u32>,
pub country_info_by_code: HashMap<String, CountryRecord>,
pub tree: ImmutableKdTree<f32, u32, 2, 32>,
pub tree_index_to_geonameid: HashMap<usize, u32>,
}
Fields§
§entries: Vec<Entry>
§geonames: HashMap<u32, CitiesRecord>
§capitals: HashMap<String, u32>
§country_info_by_code: HashMap<String, CountryRecord>
§tree: ImmutableKdTree<f32, u32, 2, 32>
§tree_index_to_geonameid: HashMap<usize, u32>
Implementations§
Source§impl IndexData
impl IndexData
pub fn new_from_files<P: AsRef<Path>>( _: SourceFileOptions<'_, P>, ) -> Result<Self, Box<dyn Error>>
pub fn new_from_files_content( _: SourceFileContentOptions<'_>, ) -> Result<Self, Box<dyn Error>>
Trait Implementations§
Source§impl Archive for IndexData
impl Archive for IndexData
Source§const COPY_OPTIMIZATION: CopyOptimization<Self>
const COPY_OPTIMIZATION: CopyOptimization<Self>
An optimization flag that allows the bytes of this type to be copied
directly to a writer instead of calling
serialize
. Read moreSource§type Archived = ArchivedIndexData
type Archived = ArchivedIndexData
The archived representation of this type. Read more
Source§type Resolver = IndexDataResolver
type Resolver = IndexDataResolver
The resolver for this type. It must contain all the additional
information from serializing needed to make the archived type from
the normal type.
Source§impl<__D: Fallible + ?Sized> Deserialize<IndexData, __D> for Archived<IndexData>where
Vec<Entry>: Archive,
<Vec<Entry> as Archive>::Archived: Deserialize<Vec<Entry>, __D>,
HashMap<u32, CitiesRecord>: Archive,
<HashMap<u32, CitiesRecord> as Archive>::Archived: Deserialize<HashMap<u32, CitiesRecord>, __D>,
HashMap<String, u32>: Archive,
<HashMap<String, u32> as Archive>::Archived: Deserialize<HashMap<String, u32>, __D>,
HashMap<String, CountryRecord>: Archive,
<HashMap<String, CountryRecord> as Archive>::Archived: Deserialize<HashMap<String, CountryRecord>, __D>,
ImmutableKdTree<f32, u32, 2, 32>: Archive,
<ImmutableKdTree<f32, u32, 2, 32> as Archive>::Archived: Deserialize<ImmutableKdTree<f32, u32, 2, 32>, __D>,
HashMap<usize, u32>: Archive,
<HashMap<usize, u32> as Archive>::Archived: Deserialize<HashMap<usize, u32>, __D>,
impl<__D: Fallible + ?Sized> Deserialize<IndexData, __D> for Archived<IndexData>where
Vec<Entry>: Archive,
<Vec<Entry> as Archive>::Archived: Deserialize<Vec<Entry>, __D>,
HashMap<u32, CitiesRecord>: Archive,
<HashMap<u32, CitiesRecord> as Archive>::Archived: Deserialize<HashMap<u32, CitiesRecord>, __D>,
HashMap<String, u32>: Archive,
<HashMap<String, u32> as Archive>::Archived: Deserialize<HashMap<String, u32>, __D>,
HashMap<String, CountryRecord>: Archive,
<HashMap<String, CountryRecord> as Archive>::Archived: Deserialize<HashMap<String, CountryRecord>, __D>,
ImmutableKdTree<f32, u32, 2, 32>: Archive,
<ImmutableKdTree<f32, u32, 2, 32> as Archive>::Archived: Deserialize<ImmutableKdTree<f32, u32, 2, 32>, __D>,
HashMap<usize, u32>: Archive,
<HashMap<usize, u32> as Archive>::Archived: Deserialize<HashMap<usize, u32>, __D>,
Auto Trait Implementations§
impl Freeze for IndexData
impl RefUnwindSafe for IndexData
impl Send for IndexData
impl Sync for IndexData
impl Unpin for IndexData
impl UnwindSafe for IndexData
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
The archived counterpart of this type. Unlike
Archive
, it may be
unsized. Read moreSource§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
Creates the archived version of the metadata for this value.
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out
indicating that a T
is niched.Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T, S> SerializeUnsized<S> for T
impl<T, S> SerializeUnsized<S> for T
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.