pub struct TapClient { /* private fields */ }Expand description
HTTP client for TAP management API.
Provides methods for managing which repositories the TAP service tracks, checking service health, and querying repository status.
§Example
ⓘ
use atproto_tap::TapClient;
let client = TapClient::new("localhost:2480", Some("admin_password".to_string()));
// Add repositories to track
client.add_repos(&["did:plc:xyz123", "did:plc:abc456"]).await?;
// Check health
if client.health().await? {
println!("TAP service is healthy");
}Implementations§
Source§impl TapClient
impl TapClient
Sourcepub fn new(hostname: &str, admin_password: Option<String>) -> Self
pub fn new(hostname: &str, admin_password: Option<String>) -> Self
Create a new TAP management client.
§Arguments
hostname- TAP service hostname (e.g., “localhost:2480”)admin_password- Optional admin password for authentication
Sourcepub async fn remove_repos(&self, dids: &[&str]) -> Result<(), TapError>
pub async fn remove_repos(&self, dids: &[&str]) -> Result<(), TapError>
Remove repositories from tracking.
Sends a POST request to /repos/remove with the list of DIDs.
§Arguments
dids- Slice of DID strings to stop tracking
Sourcepub async fn health(&self) -> Result<bool, TapError>
pub async fn health(&self) -> Result<bool, TapError>
Check service health.
Sends a GET request to /health.
§Returns
true if the service is healthy, false otherwise.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TapClient
impl !RefUnwindSafe for TapClient
impl Send for TapClient
impl Sync for TapClient
impl Unpin for TapClient
impl UnsafeUnpin for TapClient
impl !UnwindSafe for TapClient
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