pub struct BaseUrlResolver<'a> { /* private fields */ }Expand description
Resolves the base URL for an API based on a priority hierarchy
Implementations§
Source§impl<'a> BaseUrlResolver<'a>
impl<'a> BaseUrlResolver<'a>
Sourcepub const fn new(spec: &'a CachedSpec) -> Self
pub const fn new(spec: &'a CachedSpec) -> Self
Creates a new URL resolver for the given spec
Sourcepub fn with_global_config(self, config: &'a GlobalConfig) -> Self
pub fn with_global_config(self, config: &'a GlobalConfig) -> Self
Sets the global configuration for API-specific overrides
Sourcepub fn with_environment(self, env: Option<String>) -> Self
pub fn with_environment(self, env: Option<String>) -> Self
Sets the environment explicitly (overrides APERTURE_ENV)
Sourcepub fn resolve(&self, explicit_url: Option<&str>) -> String
pub fn resolve(&self, explicit_url: Option<&str>) -> String
Resolves the base URL according to the priority hierarchy:
- Explicit parameter (for testing)
- Per-API config override with environment support
- Environment variable:
APERTURE_BASE_URL - Cached spec default
- Fallback: https://api.example.com
Sourcepub fn get_api_config(&self) -> Option<&ApiConfig>
pub fn get_api_config(&self) -> Option<&ApiConfig>
Gets the API config if available
Auto Trait Implementations§
impl<'a> Freeze for BaseUrlResolver<'a>
impl<'a> RefUnwindSafe for BaseUrlResolver<'a>
impl<'a> Send for BaseUrlResolver<'a>
impl<'a> Sync for BaseUrlResolver<'a>
impl<'a> Unpin for BaseUrlResolver<'a>
impl<'a> UnwindSafe for BaseUrlResolver<'a>
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