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: SendMsg,
) -> impl Future<Output = Result<SendResponse, Error>> + Send
fn send( &mut self, req: SendMsg, ) -> impl Future<Output = Result<SendResponse, Error>> + Send
Send a message to an agent and receive a complete response.
Source§fn stream(
&mut self,
req: StreamMsg,
) -> impl Stream<Item = Result<Event, Error>> + Send
fn stream( &mut self, req: StreamMsg, ) -> impl Stream<Item = Result<Event, Error>> + Send
Send a message to an agent and receive a streamed response.
Source§fn hub(
&mut self,
req: HubMsg,
) -> impl Stream<Item = Result<Event, Error>> + Send
fn hub( &mut self, req: HubMsg, ) -> impl Stream<Item = Result<Event, Error>> + Send
Install or uninstall a hub package, streaming download events.
Source§fn ping(&mut self) -> impl Future<Output = Result<(), Error>> + Send
fn ping(&mut self) -> impl Future<Output = Result<(), Error>> + Send
Ping the server (keepalive).
Source§fn subscribe_tasks(&mut self) -> impl Stream<Item = Result<Event, Error>> + Send
fn subscribe_tasks(&mut self) -> impl Stream<Item = Result<Event, Error>> + Send
Subscribe to task lifecycle events. Read more
Source§fn subscribe_downloads(
&mut self,
) -> impl Stream<Item = Result<Event, Error>> + Send
fn subscribe_downloads( &mut self, ) -> impl Stream<Item = Result<Event, Error>> + Send
Subscribe to download lifecycle events. Read more
Source§fn get_config(&mut self) -> impl Future<Output = Result<String, Error>> + Send
fn get_config(&mut self) -> impl Future<Output = Result<String, Error>> + Send
Get the full daemon config as JSON.
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