pub struct BlockingAgentClient<S> { /* private fields */ }Expand description
A synchronous client over an already-connected local agent stream.
Embedders own endpoint discovery and platform transport creation; this type owns the version handshake and newline-delimited protocol framing.
Implementations§
Source§impl<S> BlockingAgentClient<S>
impl<S> BlockingAgentClient<S>
Sourcepub fn connect(stream: S, client_version: impl Into<String>) -> Result<Self>
pub fn connect(stream: S, client_version: impl Into<String>) -> Result<Self>
Negotiate the exact agent protocol and application version.
Sourcepub fn request(&mut self, request: AgentRequest) -> Result<AgentResponse>
pub fn request(&mut self, request: AgentRequest) -> Result<AgentResponse>
Send one request and wait for its response.
Sourcepub fn begin_task(&mut self, task: impl Into<String>) -> Result<String>
pub fn begin_task(&mut self, task: impl Into<String>) -> Result<String>
Begin a prediction-manifest run and return its opaque identifier.
Sourcepub fn commit_task(&mut self, run: impl Into<String>) -> Result<()>
pub fn commit_task(&mut self, run: impl Into<String>) -> Result<()>
Commit predictions collected for a task run.
Sourcepub fn into_inner(self) -> S
pub fn into_inner(self) -> S
Recover the connected stream.
Auto Trait Implementations§
impl<S> Freeze for BlockingAgentClient<S>
impl<S> RefUnwindSafe for BlockingAgentClient<S>where
BufReader<S>: RefUnwindSafe,
impl<S> Send for BlockingAgentClient<S>
impl<S> Sync for BlockingAgentClient<S>
impl<S> Unpin for BlockingAgentClient<S>
impl<S> UnsafeUnpin for BlockingAgentClient<S>where
BufReader<S>: UnsafeUnpin,
impl<S> UnwindSafe for BlockingAgentClient<S>where
BufReader<S>: UnwindSafe,
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