pub struct MapBoxClient { /* private fields */ }Expand description
The shared HTTP client for MapBox APIs.
Delegates to everymap_core::client::ProviderClient for common
request/response logic. Each domain module constructs its own
base URL per the MapBox API specification.
Implementations§
Source§impl MapBoxClient
impl MapBoxClient
Sourcepub fn new(auth_provider: Arc<dyn AuthProvider>) -> Self
pub fn new(auth_provider: Arc<dyn AuthProvider>) -> Self
Creates a new MapBoxClient with the given authentication provider.
Sourcepub fn with_client_builder(
builder: ClientBuilder,
auth_provider: Arc<dyn AuthProvider>,
) -> EveryMapResult<Self>
pub fn with_client_builder( builder: ClientBuilder, auth_provider: Arc<dyn AuthProvider>, ) -> EveryMapResult<Self>
Creates a MapBoxClient with a custom reqwest::Client configuration.
Sourcepub fn set_verbose(&mut self, verbose: bool)
pub fn set_verbose(&mut self, verbose: bool)
Enable or disable verbose output.
Sourcepub fn is_verbose(&self) -> bool
pub fn is_verbose(&self) -> bool
Whether verbose mode is enabled.
Sourcepub fn build_request(&self, method: Method, url: &str) -> RequestBuilder
pub fn build_request(&self, method: Method, url: &str) -> RequestBuilder
Builds a request to the given full URL with the specified HTTP method.
Sourcepub async fn request(&self, builder: RequestBuilder) -> EveryMapResult<Response>
pub async fn request(&self, builder: RequestBuilder) -> EveryMapResult<Response>
Sends a request, applying authentication first.
Sourcepub async fn request_json<T: DeserializeOwned>(
&self,
builder: RequestBuilder,
) -> EveryMapResult<T>
pub async fn request_json<T: DeserializeOwned>( &self, builder: RequestBuilder, ) -> EveryMapResult<T>
Sends a request and deserializes the JSON response into T.
Auto Trait Implementations§
impl !RefUnwindSafe for MapBoxClient
impl !UnwindSafe for MapBoxClient
impl Freeze for MapBoxClient
impl Send for MapBoxClient
impl Sync for MapBoxClient
impl Unpin for MapBoxClient
impl UnsafeUnpin for MapBoxClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more