Refactor send -> send_once -> ask

feat/RusshSupport
Chip Senkbeil 7 months ago
parent bdb07a5ac8
commit 41bf0e49cb
No known key found for this signature in database
GPG Key ID: 35EF1F8EC72A4131

@ -19,7 +19,7 @@ pub trait Client {
/// Sends a request and waits for a single response, failing if unable to send a request or if /// Sends a request and waits for a single response, failing if unable to send a request or if
/// the session's receiving line to the remote server has already been severed. /// the session's receiving line to the remote server has already been severed.
async fn send_once(&mut self, request: Request) -> io::Result<Response> { async fn ask(&mut self, request: Request) -> io::Result<Response> {
self.send(request) self.send(request)
.await? .await?
.next() .next()
@ -30,7 +30,7 @@ pub trait Client {
/// Sends a request without waiting for any response; this method is able to be used even /// Sends a request without waiting for any response; this method is able to be used even
/// if the session's receiving line to the remote server has been severed. /// if the session's receiving line to the remote server has been severed.
async fn fire(&mut self, request: Request) -> io::Result<()> { async fn fire(&mut self, request: Request) -> io::Result<()> {
let _ = self.send_once(request).await?; let _ = self.ask(request).await?;
Ok(()) Ok(())
} }
} }

Loading…
Cancel
Save