pub struct Client { /* private fields */ }Expand description
Inference-socket client.
Construct via dial_tcp / dial_uds (Unix) / dial_pipe
(Windows). Wrap with crate::dial_and_wait_ready to retry
connect during daemon bring-up.
Implementations§
Source§impl Client
impl Client
Sourcepub async fn dial_tcp(addr: &str) -> Result<Self, ClientError>
pub async fn dial_tcp(addr: &str) -> Result<Self, ClientError>
Open a TCP connection to addr (e.g. "127.0.0.1:47321").
Sourcepub async fn dial_uds(path: &Path) -> Result<Self, ClientError>
pub async fn dial_uds(path: &Path) -> Result<Self, ClientError>
Open a Unix domain socket connection (Unix only).
Sourcepub async fn generate(
&mut self,
req: Request,
) -> Result<FrameStream, ClientError>
pub async fn generate( &mut self, req: Request, ) -> Result<FrameStream, ClientError>
Send a Request and return a stream of response frames.
The stream completes after a terminal done or error frame
(or yields Err(ClientError::UnexpectedEof) if the daemon
closes the connection mid-stream).
Trait Implementations§
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