feat(core): add IoStream::shutdown and IoStream::shutdown_async

This commit is contained in:
Ryan Leckey
2021-01-11 00:45:11 -08:00
parent f748c70132
commit d07eabd201
10 changed files with 255 additions and 38 deletions

View File

@@ -1,4 +1,4 @@
use sqlx_core::{Result, Runtime};
use sqlx_core::{io::Stream, Result, Runtime};
use crate::protocol::Quit;
@@ -13,6 +13,7 @@ where
{
self.write_packet(&Quit)?;
self.stream.flush_async().await?;
self.stream.shutdown_async().await?;
Ok(())
}
@@ -24,6 +25,7 @@ where
{
self.write_packet(&Quit)?;
self.stream.flush()?;
self.stream.shutdown()?;
Ok(())
}