MobileRegionDatabase

Struct MobileRegionDatabase 

Source
pub struct MobileRegionDatabase { /* private fields */ }
Expand description

An opened region database.

Read-only, and cheap to hold open for the life of the app. The lock exists because the underlying SQLite connection is single-threaded, not because anything here blocks for long: a worst-case lookup is about a millisecond.

Implementations§

Source§

impl MobileRegionDatabase

Source

pub fn open(path: String) -> Result<Arc<Self>, MobileRegionError>

Open the database at an absolute filesystem path, read-only.

Source

pub fn dataset_version(&self) -> String

The data release this database carries, such as 2026.34.1.

Source

pub fn format_version(&self) -> u32

The database format version.

Source

pub fn region_count(&self) -> u32

How many regions the database holds.

Source

pub fn lookup( &self, latitude: f64, longitude: f64, ) -> Result<MobileRegionLookupRecord, MobileRegionError>

Every region covering one exact position, with semantic detail.

Source

pub fn propose( &self, position: MobileRegionPositionRecord, current_regions: Vec<String>, current_default_region: Option<Vec<u8>>, ) -> Result<MobileRegionProposalRecord, MobileRegionError>

Propose a region configuration for a position, against what the device currently holds.

The proposal samples the position’s uncertainty — an identity cell’s center and four corners, or a measured fix’s center and the four cardinal points of its accuracy circle — and suggests every region any sample hit. A node whose position straddles a boundary should usually forward both sides, the same reasoning that gives the database its expansion margins; the non-unanimous regions are named so the operator can judge.

Trait Implementations§

Source§

impl<UT> LiftRef<UT> for MobileRegionDatabase

Source§

impl<UT> LowerError<UT> for MobileRegionDatabase

Source§

fn lower_error(obj: Self) -> RustBuffer

Lower this value for scaffolding function return Read more
Source§

impl<UT> LowerReturn<UT> for MobileRegionDatabase

Source§

type ReturnType = <Arc<MobileRegionDatabase> as LowerReturn<UniFfiTag>>::ReturnType

The type that should be returned by scaffolding functions for this type. Read more
Source§

fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>

Lower the return value from an scaffolding call Read more
Source§

fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>

Lower the return value for failed argument lifts Read more
Source§

impl<UT> TypeId<UT> for MobileRegionDatabase

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

Source§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
Source§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
Source§

unsafe fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<> Read more
Source§

unsafe fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. Read more
§

impl<T, U> Into<U> for T
where U: From<T>,

§

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

Source§

type Output = T

Should always be Self
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.