commit d6793efde079a565c9c964e630c3be6034658d72
parent 5247dd45151031fbdf78712215b9530356ea94d3
Author: triesap <tyson@radroots.org>
Date: Sun, 22 Mar 2026 11:43:04 +0000
core: add async reverse lookup contract
- add a typed reverse-lookup result alias to the shared location resolver boundary
- add backend hooks to begin and poll reverse location lookups without blocking the ui thread
- keep the existing synchronous resolver methods available for non-ui call sites during the transition
- preserve current runtime behavior until the platform backends and home lookup ui switch to the new contract
Diffstat:
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/crates/core/src/lib.rs b/crates/core/src/lib.rs
@@ -12,7 +12,7 @@ pub const APP_NAME: &str = "Rad Roots";
pub use location_resolver::{
RadrootsLocationCountry, RadrootsLocationPoint, RadrootsLocationResolverError,
- RadrootsLocationReverseOptions, RadrootsResolvedLocation,
+ RadrootsLocationReverseOptions, RadrootsResolvedLocation, RadrootsReverseLocationLookupResult,
};
pub use offline_geocoder::{
RadrootsOfflineGeocoderDiagnostic, RadrootsOfflineGeocoderPlatform,
@@ -116,6 +116,18 @@ pub trait RadrootsAppBackend {
) -> Result<Vec<RadrootsResolvedLocation>, RadrootsLocationResolverError> {
Err(RadrootsLocationResolverError::Unsupported)
}
+ fn request_reverse_location_lookup(
+ &self,
+ _point: RadrootsLocationPoint,
+ _options: Option<RadrootsLocationReverseOptions>,
+ ) -> Result<(), RadrootsLocationResolverError> {
+ Err(RadrootsLocationResolverError::Unsupported)
+ }
+ fn poll_reverse_location_lookup_result(
+ &self,
+ ) -> Result<Option<RadrootsReverseLocationLookupResult>, String> {
+ Ok(None)
+ }
fn list_location_countries(
&self,
) -> Result<Vec<RadrootsLocationCountry>, RadrootsLocationResolverError> {
diff --git a/crates/core/src/location_resolver.rs b/crates/core/src/location_resolver.rs
@@ -30,6 +30,9 @@ pub struct RadrootsResolvedLocation {
pub point: RadrootsLocationPoint,
}
+pub type RadrootsReverseLocationLookupResult =
+ Result<Vec<RadrootsResolvedLocation>, RadrootsLocationResolverError>;
+
#[derive(Debug, Clone, PartialEq)]
pub struct RadrootsLocationCountry {
pub country_id: String,