pub struct Connection { /* private fields */ }Expand description
An established Unix domain socket connection to a walrus daemon.
Not Clone — one connection per session. Use WalrusClient::connect
to create a connection.
Implementations§
Trait Implementations§
Source§impl Client for Connection
impl Client for Connection
Source§async fn request(&mut self, msg: ClientMessage) -> Result<ServerMessage>
async fn request(&mut self, msg: ClientMessage) -> Result<ServerMessage>
Send a
ClientMessage and receive a single ServerMessage.Source§fn request_stream(
&mut self,
msg: ClientMessage,
) -> impl Stream<Item = Result<ServerMessage>> + Send + '_
fn request_stream( &mut self, msg: ClientMessage, ) -> impl Stream<Item = Result<ServerMessage>> + Send + '_
Source§fn send(
&mut self,
req: SendRequest,
) -> impl Future<Output = Result<SendResponse, Error>> + Send
fn send( &mut self, req: SendRequest, ) -> impl Future<Output = Result<SendResponse, Error>> + Send
Send a message to an agent and receive a complete response.
Source§fn stream(
&mut self,
req: StreamRequest,
) -> impl Stream<Item = Result<StreamEvent, Error>> + Send
fn stream( &mut self, req: StreamRequest, ) -> impl Stream<Item = Result<StreamEvent, Error>> + Send
Send a message to an agent and receive a streamed response.
Source§fn download(
&mut self,
req: DownloadRequest,
) -> impl Stream<Item = Result<DownloadEvent, Error>> + Send
fn download( &mut self, req: DownloadRequest, ) -> impl Stream<Item = Result<DownloadEvent, Error>> + Send
Download a model’s files with progress reporting.
Auto Trait Implementations§
impl Freeze for Connection
impl RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnsafeUnpin for Connection
impl UnwindSafe for Connection
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