pub trait Provider: Send + Sync {
    fn name(&self) -> &str;
    fn get_location<'life0, 'life1, 'async_trait>(
        &'life0 self,
        request: &'life1 HttpRequest
    ) -> Pin<Box<dyn Future<Output = Result<Option<Location>, Error>> + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn expect_country(&self) -> bool { ... } fn expect_region(&self) -> bool { ... } fn expect_city(&self) -> bool { ... } }
Expand description

An object that can be queried to convert HttpRequest into locations.

Use async_trait when implementing.

Required Methods

Provide a name of the provider for use in diagnostics.

Derive a location from a request’s metadata.

Provided Methods

Can this provider produce locations with country information?

Can this provider produce locations with region information?

Can this provider produce locations with city information?

Implementors