Struct OsmAdmin

Source
pub struct OsmAdmin {
    pub id: usize,
    pub name: EncodableString,
    pub level: usize,
    pub geometry: EncodableGeometry,
}
Expand description

A representation of the OpenStreetMap geojson geojson::Features for administrative areas.

Fields§

§id: usize

The index of the OsmAdmin in the global static cache.

This is is not stable across builds or new data sets. It is merely unique during a single build.

§name: EncodableString

The name of the OsmAdmin (e.g., Burkina Faso).

§level: usize

The level of the OsmAdmin (e.g., 3).

§geometry: EncodableGeometry

The geometry of the OsmAdmin.

Trait Implementations§

Source§

impl CanGetGeoJsonFeaturesFromSource for OsmAdmin

Source§

fn get_geojson_features_from_source() -> FeatureCollection

Get the GeoJSON features from a source.
Source§

impl CanPerformGeoLookup for OsmAdmin

Source§

fn lookup(xf: Float, yf: Float) -> Vec<&'static Self>

Get the cache-driven item for a given longitude (x) and latitude (y). Read more
Source§

fn lookup_slow(xf: Float, yf: Float) -> Vec<&'static Self>

Get the exact item for a given longitude (x) and latitude (y).
Source§

fn memory_data_to_geojson() -> String

Gets the geojson representation of the memory cache.
Source§

fn get_lookup_suggestions( x: RoundDegree, y: RoundDegree, ) -> Option<Vec<&'static Self>>

Get value from the static memory cache.
Source§

impl Debug for OsmAdmin

Source§

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

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

impl From<&'static OsmAdmin> for OsmAdminResponse1

Source§

fn from(value: &'static OsmAdmin) -> OsmAdminResponse1

Converts to this type from the input type.
Source§

impl From<(usize, Feature)> for OsmAdmin

Source§

fn from(value: (usize, Feature)) -> OsmAdmin

Converts to this type from the input type.
Source§

impl HasGeometry for OsmAdmin

Source§

fn id(&self) -> usize

Get the id of the HasGeometry.
Source§

fn geometry(&self) -> &Geometry<f32>

Get the Geometry of the HasGeometry.
Source§

impl HasItemData for OsmAdmin

Source§

fn get_mem_items() -> &'static ConcreteVec<OsmAdmin>

Gets the items from the in-memory cache for the given type.
Source§

impl HasLookupData for OsmAdmin

Source§

type Lookup = EncodableIds

The type to which the lookup hash table resolves.
Source§

fn get_mem_lookup() -> &'static HashMap<RoundLngLat, Self::Lookup>

Gets the lookup hash table from the in-memory cache for the given type.
Source§

impl HasProperties for OsmAdmin

Source§

fn properties(&self) -> Map<String, Value>

Get the properties of the HasProperties.
Source§

impl IsAdmin for OsmAdmin

Source§

fn name(&self) -> &str

Get the name of the IsAdmin.
Source§

impl PartialEq for OsmAdmin

Source§

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

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToGeoJsonFeature for T

Source§

fn to_feature(&self) -> Feature

Convert the type to GeoJSON.
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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool

Source§

impl<T> Erased for T

Source§

impl<T> ErasedDestructor for T
where T: 'static,