Client

Struct Client 

Source
pub struct Client { /* private fields */ }
Expand description

Main entry point for interacting with an agtrace workspace.

Implementations§

Source§

impl Client

Source

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?;
Source

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):

  1. AGTRACE_PATH environment variable
  2. System data directory + “agtrace” (e.g., ~/.local/share/agtrace)
§Examples
let client = Client::connect_default().await?;
Source

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?;
Source

pub fn sessions(&self) -> SessionClient

Access session operations.

Source

pub fn projects(&self) -> ProjectClient

Access project operations.

Source

pub fn watch(&self) -> WatchClient

Access watch/monitoring operations.

Source

pub fn insights(&self) -> InsightClient

Access insights/analysis operations.

Source

pub fn system(&self) -> SystemClient

Access system operations (init, index, doctor, provider).

Source

pub fn watch_service(&self) -> WatchService

Get the watch service for low-level watch operations. Prefer using client.watch() for most use cases.

Auto Trait Implementations§

§

impl Freeze for Client

§

impl RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl UnwindSafe for Client

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.