pub struct DaemonClient { /* private fields */ }Expand description
A client that connects to the Astrid daemon via WebSocket.
Unlike the CLI client, this does not auto-start the daemon. The daemon must already be running.
Implementations§
Source§impl DaemonClient
impl DaemonClient
Sourcepub async fn connect_url(url: &str) -> Result<Self, TelegramBotError>
pub async fn connect_url(url: &str) -> Result<Self, TelegramBotError>
Connect to the daemon at the given URL.
Sourcepub async fn connect_discover() -> Result<Self, TelegramBotError>
pub async fn connect_discover() -> Result<Self, TelegramBotError>
Connect to the daemon, auto-discovering the port from
~/.astrid/daemon.port.
Sourcepub async fn connect(daemon_url: Option<&str>) -> Result<Self, TelegramBotError>
pub async fn connect(daemon_url: Option<&str>) -> Result<Self, TelegramBotError>
Connect using an explicit URL or fall back to auto-discovery.
Sourcepub async fn create_session(
&self,
workspace_path: Option<PathBuf>,
) -> Result<SessionInfo, TelegramBotError>
pub async fn create_session( &self, workspace_path: Option<PathBuf>, ) -> Result<SessionInfo, TelegramBotError>
Create a new session.
Sourcepub async fn end_session(
&self,
session_id: &SessionId,
) -> Result<(), TelegramBotError>
pub async fn end_session( &self, session_id: &SessionId, ) -> Result<(), TelegramBotError>
End a session.
Sourcepub async fn send_input(
&self,
session_id: &SessionId,
input: &str,
) -> Result<(), TelegramBotError>
pub async fn send_input( &self, session_id: &SessionId, input: &str, ) -> Result<(), TelegramBotError>
Send user input to a session.
Sourcepub async fn subscribe_events(
&self,
session_id: &SessionId,
) -> Result<Subscription<DaemonEvent>, TelegramBotError>
pub async fn subscribe_events( &self, session_id: &SessionId, ) -> Result<Subscription<DaemonEvent>, TelegramBotError>
Subscribe to session events.
Sourcepub async fn send_approval(
&self,
session_id: &SessionId,
request_id: &str,
decision: ApprovalDecision,
) -> Result<(), TelegramBotError>
pub async fn send_approval( &self, session_id: &SessionId, request_id: &str, decision: ApprovalDecision, ) -> Result<(), TelegramBotError>
Respond to an approval request.
Sourcepub async fn send_elicitation(
&self,
session_id: &SessionId,
request_id: &str,
response: ElicitationResponse,
) -> Result<(), TelegramBotError>
pub async fn send_elicitation( &self, session_id: &SessionId, request_id: &str, response: ElicitationResponse, ) -> Result<(), TelegramBotError>
Respond to an elicitation request.
Sourcepub async fn cancel_turn(
&self,
session_id: &SessionId,
) -> Result<(), TelegramBotError>
pub async fn cancel_turn( &self, session_id: &SessionId, ) -> Result<(), TelegramBotError>
Cancel the current turn.
Sourcepub async fn status(&self) -> Result<DaemonStatus, TelegramBotError>
pub async fn status(&self) -> Result<DaemonStatus, TelegramBotError>
Get daemon status.
Sourcepub async fn session_budget(
&self,
session_id: &SessionId,
) -> Result<BudgetInfo, TelegramBotError>
pub async fn session_budget( &self, session_id: &SessionId, ) -> Result<BudgetInfo, TelegramBotError>
Get budget info for a session.
Auto Trait Implementations§
impl !Freeze for DaemonClient
impl !RefUnwindSafe for DaemonClient
impl Send for DaemonClient
impl Sync for DaemonClient
impl Unpin for DaemonClient
impl UnsafeUnpin for DaemonClient
impl !UnwindSafe for DaemonClient
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
Source§impl<T> Erasable for T
impl<T> Erasable for T
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more