pub struct TxAsync(/* private fields */);Implementations§
Source§impl TxAsync
impl TxAsync
pub fn new(tx: Tx) -> Self
pub fn inner(&mut self) -> &mut Tx
Sourcepub async fn write(&mut self, buf: &[u8]) -> Result<usize, TxOverrunError>
pub async fn write(&mut self, buf: &[u8]) -> Result<usize, TxOverrunError>
Write a buffer asynchronously.
This implementation is not side effect free, and a started future might have already written part of the passed buffer.
Sourcepub async fn write_all(&mut self, buf: &[u8]) -> Result<(), TxOverrunError>
pub async fn write_all(&mut self, buf: &[u8]) -> Result<(), TxOverrunError>
Write an entire buffer into this writer.
This function calls write() in a loop until exactly buf.len() bytes have
been written, waiting if needed.
This function is not side-effect-free on cancel (AKA “cancel-safe”), i.e. if you cancel (drop) a returned future that hasn’t completed yet, some bytes might have already been written.
pub async fn flush(&mut self) -> Result<(), TxOverrunError>
pub fn release(self) -> Tx
Trait Implementations§
Source§impl ErrorType for TxAsync
impl ErrorType for TxAsync
Source§type Error = TxOverrunError
type Error = TxOverrunError
Error type of all the IO operations on this type.
Source§impl Write for TxAsync
impl Write for TxAsync
Source§async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
Write a buffer asynchronously.
This implementation is not side effect free, and a started future might have already written part of the passed buffer.
Auto Trait Implementations§
impl Freeze for TxAsync
impl RefUnwindSafe for TxAsync
impl Send for TxAsync
impl !Sync for TxAsync
impl Unpin for TxAsync
impl UnsafeUnpin for TxAsync
impl UnwindSafe for TxAsync
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