pub struct ApiClient { /* private fields */ }Expand description
HTTP client for interacting with the Carp registry API
Implementations§
Source§impl ApiClient
impl ApiClient
Sourcepub fn new(config: &Config) -> CarpResult<Self>
pub fn new(config: &Config) -> CarpResult<Self>
Create a new API client from configuration
Sourcepub async fn search(
&self,
query: &str,
limit: Option<usize>,
exact: bool,
) -> CarpResult<SearchResponse>
pub async fn search( &self, query: &str, limit: Option<usize>, exact: bool, ) -> CarpResult<SearchResponse>
Search for agents in the registry
Sourcepub async fn get_agent_download(
&self,
name: &str,
version: Option<&str>,
) -> CarpResult<AgentDownload>
pub async fn get_agent_download( &self, name: &str, version: Option<&str>, ) -> CarpResult<AgentDownload>
Get download information for a specific agent
Sourcepub async fn download_agent(&self, download_url: &str) -> CarpResult<Bytes>
pub async fn download_agent(&self, download_url: &str) -> CarpResult<Bytes>
Download agent content
Sourcepub async fn publish(
&self,
request: PublishRequest,
content: Vec<u8>,
) -> CarpResult<PublishResponse>
pub async fn publish( &self, request: PublishRequest, content: Vec<u8>, ) -> CarpResult<PublishResponse>
Publish an agent to the registry
Sourcepub async fn authenticate(
&self,
username: &str,
password: &str,
) -> CarpResult<AuthResponse>
pub async fn authenticate( &self, username: &str, password: &str, ) -> CarpResult<AuthResponse>
Authenticate with the registry
Auto Trait Implementations§
impl Freeze for ApiClient
impl !RefUnwindSafe for ApiClient
impl Send for ApiClient
impl Sync for ApiClient
impl Unpin for ApiClient
impl !UnwindSafe for ApiClient
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