pub struct Client { /* private fields */ }Expand description
Main entry point for interacting with an agtrace workspace.
Implementations§
Source§impl Client
impl Client
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Create a new ClientBuilder for configuring workspace connection.
This is the recommended way to connect to a workspace as it supports XDG-compliant path resolution and environment variable configuration.
§Examples
// Use default path
let client = Client::builder().connect().await?;
// Use custom path
let client = Client::builder()
.path("/custom/agtrace")
.connect().await?;Sourcepub async fn connect_default() -> Result<Self>
pub async fn connect_default() -> Result<Self>
Connect to the default agtrace workspace.
This is a convenience method that uses XDG-compliant path resolution. It checks (in order):
AGTRACE_PATHenvironment variable- System data directory + “agtrace” (e.g.,
~/.local/share/agtrace)
§Examples
let client = Client::connect_default().await?;Sourcepub async fn connect(path: impl Into<PathBuf>) -> Result<Self>
pub async fn connect(path: impl Into<PathBuf>) -> Result<Self>
Connect to an agtrace workspace at the given path.
This is a low-level API. Consider using Client::builder() or
Client::connect_default() for better ergonomics and XDG support.
§Examples
let client = Client::connect("/custom/agtrace/path").await?;Sourcepub fn sessions(&self) -> SessionClient
pub fn sessions(&self) -> SessionClient
Access session operations.
Sourcepub fn projects(&self) -> ProjectClient
pub fn projects(&self) -> ProjectClient
Access project operations.
Sourcepub fn watch(&self) -> WatchClient
pub fn watch(&self) -> WatchClient
Access watch/monitoring operations.
Sourcepub fn insights(&self) -> InsightClient
pub fn insights(&self) -> InsightClient
Access insights/analysis operations.
Sourcepub fn system(&self) -> SystemClient
pub fn system(&self) -> SystemClient
Access system operations (init, index, doctor, provider).
Sourcepub fn watch_service(&self) -> WatchService
pub fn watch_service(&self) -> WatchService
Get the watch service for low-level watch operations.
Prefer using client.watch() for most use cases.