pub struct Client;Expand description
The client role - typically an IDE or CLI that controls an agent.
Clients send prompts and receive responses from agents.
Implementations§
Source§impl Client
impl Client
Sourcepub fn builder(self) -> Builder<Client, NullHandler, NullRun>
pub fn builder(self) -> Builder<Client, NullHandler, NullRun>
Create a connection builder for a client.
Sourcepub async fn connect_with<R>(
self,
agent: impl ConnectTo<Client>,
main_fn: impl AsyncFnOnce(ConnectionTo<Agent>) -> Result<R, Error>,
) -> Result<R, Error>
pub async fn connect_with<R>( self, agent: impl ConnectTo<Client>, main_fn: impl AsyncFnOnce(ConnectionTo<Agent>) -> Result<R, Error>, ) -> Result<R, Error>
Connect to agent and run main_fn with the ConnectionTo.
Returns the result of main_fn (or an error if something goes wrong).
Equivalent to self.builder().connect_with(agent, main_fn).
Trait Implementations§
Source§impl HasPeer<Client> for Client
impl HasPeer<Client> for Client
Source§fn remote_style(&self, _peer: Client) -> RemoteStyle
fn remote_style(&self, _peer: Client) -> RemoteStyle
Returns the remote style for sending to this peer.
Source§impl HasPeer<Client> for Conductor
impl HasPeer<Client> for Conductor
Source§fn remote_style(&self, _peer: Client) -> RemoteStyle
fn remote_style(&self, _peer: Client) -> RemoteStyle
Returns the remote style for sending to this peer.
Source§impl Ord for Client
impl Ord for Client
Source§impl PartialOrd for Client
impl PartialOrd for Client
Source§impl Role for Client
impl Role for Client
Source§type Counterpart = Agent
type Counterpart = Agent
The role that this endpoint connects to. Read more
Source§async fn default_handle_dispatch_from(
&self,
message: Dispatch,
_connection: ConnectionTo<Client>,
) -> Result<Handled<Dispatch>, Error>
async fn default_handle_dispatch_from( &self, message: Dispatch, _connection: ConnectionTo<Client>, ) -> Result<Handled<Dispatch>, Error>
Method invoked when there is no defined message handler.
Source§fn counterpart(&self) -> Self::Counterpart
fn counterpart(&self) -> Self::Counterpart
Returns the counterpart role.
impl Copy for Client
impl Eq for Client
impl StructuralPartialEq for Client
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl UnwindSafe for Client
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