pub struct AddressDescriptor {
pub landmarks: Vec<Landmark>,
pub areas: Vec<Area>,
}Expand description
A relational description of a location using landmarks and containing areas.
Address descriptors provide rich contextual information about a location by describing its relationship to nearby landmarks and the areas that contain or are adjacent to it. This helps users understand where a place is situated using familiar reference points and geographic boundaries.
The landmarks and areas are ranked by recognizability and relevance, with the most useful contextual information appearing first in their respective lists.
Fields§
§landmarks: Vec<Landmark>A ranked list of nearby landmarks that help describe the location.
Contains prominent places that can be used as reference points for describing the location. Landmarks are ordered by recognizability and proximity, with the most useful references appearing first. Each landmark includes spatial relationship information.
areas: Vec<Area>A ranked list of containing or adjacent areas that provide geographic context.
Contains precise sublocalities, neighborhoods, and geographic regions that help establish where the location sits within the broader area structure. Areas are ordered by precision and recognizability, with the most specific and well-known areas listed first.
Implementations§
Source§impl AddressDescriptor
impl AddressDescriptor
Sourcepub fn landmarks(&self) -> &Vec<Landmark>
pub fn landmarks(&self) -> &Vec<Landmark>
A ranked list of nearby landmarks that help describe the location.
Contains prominent places that can be used as reference points for describing the location. Landmarks are ordered by recognizability and proximity, with the most useful references appearing first. Each landmark includes spatial relationship information.
Sourcepub fn areas(&self) -> &Vec<Area>
pub fn areas(&self) -> &Vec<Area>
A ranked list of containing or adjacent areas that provide geographic context.
Contains precise sublocalities, neighborhoods, and geographic regions that help establish where the location sits within the broader area structure. Areas are ordered by precision and recognizability, with the most specific and well-known areas listed first.
Source§impl AddressDescriptor
impl AddressDescriptor
Sourcepub const fn new(landmarks: Vec<Landmark>, areas: Vec<Area>) -> Self
pub const fn new(landmarks: Vec<Landmark>, areas: Vec<Area>) -> Self
Creates a new AddressDescriptor with the specified landmarks and areas.
Used to construct address descriptors with curated lists of contextual references. Both landmarks and areas should be pre-sorted by relevance and recognizability.
Sourcepub const fn empty() -> Self
pub const fn empty() -> Self
Creates an empty AddressDescriptor with no contextual information.
Used when initializing address descriptors that will be populated later or when no landmark or area context is available for a location.
Sourcepub fn has_context(&self) -> bool
pub fn has_context(&self) -> bool
Returns whether this descriptor has any contextual information.
Used to determine if the descriptor provides any useful location context through landmarks or areas, helping decide whether to display contextual information.
Sourcepub fn landmark_count(&self) -> usize
pub fn landmark_count(&self) -> usize
Returns the number of landmarks available for reference.
Used to understand the richness of landmark-based context available for describing this location to users.
Sourcepub fn area_count(&self) -> usize
pub fn area_count(&self) -> usize
Returns the number of areas that provide geographic context.
Used to understand how much area-based geographic context is available for situating this location within broader regions.
Trait Implementations§
Source§impl Clone for AddressDescriptor
impl Clone for AddressDescriptor
Source§fn clone(&self) -> AddressDescriptor
fn clone(&self) -> AddressDescriptor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more