Struct OwnedWriteHalf

Source
#[repr(transparent)]
pub struct OwnedWriteHalf<T>(pub Rc<UnsafeCell<T>>) where T: AsyncWriteRent;
Expand description

Owned Write Half Part

Tuple Fields§

§0: Rc<UnsafeCell<T>>

Implementations§

Source§

impl<T> OwnedWriteHalf<T>
where T: AsyncWriteRent,

Source

pub fn reunite(self, other: OwnedReadHalf<T>) -> Result<T, ReuniteError<T>>

reunite read half

Source§

impl OwnedWriteHalf<TcpStream>

Source

pub fn peer_addr(&self) -> Result<SocketAddr>

Returns the remote address that this stream is connected to.

Source

pub fn local_addr(&self) -> Result<SocketAddr>

Returns the local address that this stream is bound to.

Trait Implementations§

Source§

impl<Inner> AsyncWriteRent for OwnedWriteHalf<Inner>
where Inner: AsyncWriteRent,

Source§

fn write<T: IoBuf>( &mut self, buf: T, ) -> impl Future<Output = BufResult<usize, T>>

Writes the contents of a buffer into this writer, returning the number of bytes written. Read more
Source§

fn writev<T: IoVecBuf>( &mut self, buf_vec: T, ) -> impl Future<Output = BufResult<usize, T>>

This function attempts to write the entire contents of buf_vec, but the write may not fully succeed, and it might also result in an error. The bytes will be written starting at the specified offset. Read more
Source§

fn flush(&mut self) -> impl Future<Output = Result<()>>

Flushes this output stream, ensuring that all buffered content is successfully written to its destination. Read more
Source§

fn shutdown(&mut self) -> impl Future<Output = Result<()>>

Shuts down the output stream, ensuring that the value can be cleanly dropped. Read more
Source§

impl<Inner> CancelableAsyncWriteRent for OwnedWriteHalf<Inner>

Source§

fn cancelable_write<T: IoBuf>( &mut self, buf: T, c: CancelHandle, ) -> impl Future<Output = BufResult<usize, T>>

Same as write(2)
Source§

fn cancelable_writev<T: IoVecBuf>( &mut self, buf_vec: T, c: CancelHandle, ) -> impl Future<Output = BufResult<usize, T>>

Same as writev(2)
Source§

fn cancelable_flush( &mut self, c: CancelHandle, ) -> impl Future<Output = Result<()>>

Flush buffered data if needed
Source§

fn cancelable_shutdown( &mut self, c: CancelHandle, ) -> impl Future<Output = Result<()>>

Same as shutdown
Source§

impl<T> Debug for OwnedWriteHalf<T>
where T: AsyncWriteRent + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> Drop for OwnedWriteHalf<T>
where T: AsyncWriteRent,

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<T> Freeze for OwnedWriteHalf<T>

§

impl<T> !RefUnwindSafe for OwnedWriteHalf<T>

§

impl<T> !Send for OwnedWriteHalf<T>

§

impl<T> !Sync for OwnedWriteHalf<T>

§

impl<T> Unpin for OwnedWriteHalf<T>

§

impl<T> !UnwindSafe for OwnedWriteHalf<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<A> AsyncWriteRentExt for A
where A: AsyncWriteRent + ?Sized,

Source§

async fn write_all<T>(&mut self, buf: T) -> (Result<usize, Error>, T)
where T: IoBuf + 'static,

Write all
Source§

async fn write_vectored_all<T>(&mut self, buf: T) -> (Result<usize, Error>, T)
where T: IoVecBuf + 'static,

Write vectored all
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<A> CancelableAsyncWriteRentExt for A

Source§

async fn write_all<T>( &mut self, buf: T, c: CancelHandle, ) -> (Result<usize, Error>, T)
where T: IoBuf + 'static,

Write all
Source§

async fn write_vectored_all<T>( &mut self, buf: T, c: CancelHandle, ) -> (Result<usize, Error>, T)
where T: IoVecBuf + 'static,

Write all
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.