pub struct ApiRegistry { /* private fields */ }Expand description
Registry of loaded API specs. Each API has a name, base URL, and parsed endpoints.
Implementations§
Source§impl ApiRegistry
impl ApiRegistry
pub fn new() -> Self
Sourcepub fn add_api(
&mut self,
name: &str,
base_url: &str,
spec_json: &str,
auth: ApiAuth,
) -> Result<usize, String>
pub fn add_api( &mut self, name: &str, base_url: &str, spec_json: &str, auth: ApiAuth, ) -> Result<usize, String>
Add an API from a JSON spec string.
Sourcepub fn add_api_from_value(
&mut self,
name: &str,
base_url: &str,
spec: &Value,
auth: ApiAuth,
) -> usize
pub fn add_api_from_value( &mut self, name: &str, base_url: &str, spec: &Value, auth: ApiAuth, ) -> usize
Add an API from a pre-parsed spec Value.
Sourcepub async fn load_popular(&mut self, name: &str) -> Result<usize, String>
pub async fn load_popular(&mut self, name: &str) -> Result<usize, String>
Load a popular API by name — auto-download + cache. Returns endpoint count or error.
Sourcepub async fn load_spec(&mut self, api_spec: &ApiSpec) -> Result<usize, String>
pub async fn load_spec(&mut self, api_spec: &ApiSpec) -> Result<usize, String>
Load any ApiSpec — download (or use cache) and register.
Sourcepub fn endpoint_count(&self, api_name: &str) -> usize
pub fn endpoint_count(&self, api_name: &str) -> usize
Get endpoint count for an API.
Sourcepub fn search(
&self,
api_name: &str,
query: &str,
limit: usize,
) -> Vec<SearchResult>
pub fn search( &self, api_name: &str, query: &str, limit: usize, ) -> Vec<SearchResult>
Search endpoints within a specific API.
Sourcepub fn search_all(
&self,
query: &str,
limit: usize,
) -> Vec<(String, SearchResult)>
pub fn search_all( &self, query: &str, limit: usize, ) -> Vec<(String, SearchResult)>
Search across ALL loaded APIs.
Trait Implementations§
Source§impl Default for ApiRegistry
impl Default for ApiRegistry
Source§fn default() -> ApiRegistry
fn default() -> ApiRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ApiRegistry
impl RefUnwindSafe for ApiRegistry
impl Send for ApiRegistry
impl Sync for ApiRegistry
impl Unpin for ApiRegistry
impl UnsafeUnpin for ApiRegistry
impl UnwindSafe for ApiRegistry
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