pub struct BoxAsyncOutput<O>where
O: AsyncOutput + ?Sized,{ /* private fields */ }Expand description
Adapts an owned pinned boxed asynchronous output, including a trait object.
§Type Parameters
O: The boxed asynchronous output type, which may be unsized and non-Unpin.
Implementations§
Source§impl<O> BoxAsyncOutput<O>where
O: AsyncOutput + ?Sized,
impl<O> BoxAsyncOutput<O>where
O: AsyncOutput + ?Sized,
Sourcepub fn get_ref(&self) -> &O
pub fn get_ref(&self) -> &O
Returns a shared reference to the boxed asynchronous output.
§Returns
Returns the wrapped asynchronous output.
Sourcepub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut O>
pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut O>
Projects a pinned adapter to its pinned boxed asynchronous output.
§Returns
Returns a pinned mutable reference to the wrapped output without moving it.
Sourcepub fn into_inner(self) -> Pin<Box<O>>
pub fn into_inner(self) -> Pin<Box<O>>
Consumes this adapter and returns its pinned boxed asynchronous output.
§Returns
Returns the pinned boxed output so a potentially non-Unpin value stays
pinned after extraction.
Trait Implementations§
Source§impl<O> AsyncClose for BoxAsyncOutput<O>where
O: AsyncClose + ?Sized,
impl<O> AsyncClose for BoxAsyncOutput<O>where
O: AsyncClose + ?Sized,
Source§fn close_async(&mut self) -> CloseFuture<'_, Self> ⓘ
fn close_async(&mut self) -> CloseFuture<'_, Self> ⓘ
Source§impl<O> AsyncOutput for BoxAsyncOutput<O>where
O: AsyncOutput + ?Sized,
impl<O> AsyncOutput for BoxAsyncOutput<O>where
O: AsyncOutput + ?Sized,
Source§type Item = <O as AsyncOutput>::Item
type Item = <O as AsyncOutput>::Item
Item type written to the wrapped asynchronous output.
Source§fn is_buffered(&self) -> bool
fn is_buffered(&self) -> bool
Returns the wrapped output’s buffering capability.
§Returns
Returns true when the wrapped output is buffered.
Source§unsafe fn poll_write_unchecked(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
input: &[Self::Item],
index: usize,
count: usize,
) -> Poll<Result<usize>>
unsafe fn poll_write_unchecked( self: Pin<&mut Self>, cx: &mut Context<'_>, input: &[Self::Item], index: usize, count: usize, ) -> Poll<Result<usize>>
Forwards an unchecked asynchronous write to the pinned boxed output.
§Parameters
cx: Task context used to register a wake-up.input: Source item slice.index: Starting source index.count: Maximum number of items to write.
§Returns
Returns a pending state or the wrapped output’s ready write result.
§Errors
Returns an error reported by the wrapped output.
§Safety
The range index..index + count must be valid for input.