pub trait GridSystem: Default {
type Identifier: GridIdentifier;
type Poly: GridPolygon<Identifier = Self::Identifier>;
// Required methods
fn name(&self) -> &str;
fn defining_agency(&self) -> Agency;
fn lookup_id(
&self,
id: &Self::Identifier,
) -> Result<Option<Self::Poly>, GeoError>;
// Provided method
fn lookup_point(
&self,
point: &Coordinate,
) -> Result<Option<Self::Poly>, GeoError> { ... }
}Expand description
A grid system that can convert identifiers and coordinates to cell polygons.
Required Associated Types§
type Identifier: GridIdentifier
type Poly: GridPolygon<Identifier = Self::Identifier>
Required Methods§
Sourcefn name(&self) -> &str
fn name(&self) -> &str
The human-readable name of this grid system (e.g. "Maidenhead Locator System").
Sourcefn defining_agency(&self) -> Agency
fn defining_agency(&self) -> Agency
The agency that defines or maintains this grid system.
Provided Methods§
Sourcefn lookup_point(
&self,
point: &Coordinate,
) -> Result<Option<Self::Poly>, GeoError>
fn lookup_point( &self, point: &Coordinate, ) -> Result<Option<Self::Poly>, GeoError>
Look up the polygon for the cell that contains point.
The default implementation converts the coordinate to an identifier and delegates
to lookup_id.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.