pub trait MultipartWrite<Part> {
type Ret;
type Output;
type Error;
// Required methods
fn poll_ready(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>;
fn start_send(
self: Pin<&mut Self>,
part: Part,
) -> Result<Self::Ret, Self::Error>;
fn poll_flush(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>;
fn poll_complete(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<Self::Output, Self::Error>>;
}Expand description
MultipartWrite is a Sink-like interface for asynchronously writing an
object in parts.
Required Associated Types§
Required Methods§
Sourcefn poll_ready(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>
fn poll_ready( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>
Attempts to prepare the MultipartWrite to receive a new part.
This method must be called and return Poll::Ready before each call to
start_send, indicating that the underlying writer is ready to have
another part written to it.
This method returns Poll::Pending when the object being prepared cannot
accept another part.
Sourcefn start_send(
self: Pin<&mut Self>,
part: Part,
) -> Result<Self::Ret, Self::Error>
fn start_send( self: Pin<&mut Self>, part: Part, ) -> Result<Self::Ret, Self::Error>
Begin the process of writing a part to this writer, returning the associated type confirming this was done successfully.
Like Sink, this should be preceded by a call to poll_ready that
returns Poll::Ready to ensure that the MultipartWrite is ready to
receive a new part.
§Errors
Errors returned by this method are implementation-specific, but it is
always an error to call start_send when poll_ready would return
Poll::Pending.
Implementations on Foreign Types§
Source§impl<P, Part> MultipartWrite<Part> for Pin<P>
impl<P, Part> MultipartWrite<Part> for Pin<P>
type Ret = <<P as Deref>::Target as MultipartWrite<Part>>::Ret
type Output = <<P as Deref>::Target as MultipartWrite<Part>>::Output
type Error = <<P as Deref>::Target as MultipartWrite<Part>>::Error
fn poll_ready( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>
fn start_send( self: Pin<&mut Self>, part: Part, ) -> Result<Self::Ret, Self::Error>
fn poll_flush( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>
fn poll_complete( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<Self::Output, Self::Error>>
Source§impl<W: ?Sized + MultipartWrite<Part> + Unpin, Part> MultipartWrite<Part> for &mut W
impl<W: ?Sized + MultipartWrite<Part> + Unpin, Part> MultipartWrite<Part> for &mut W
type Ret = <W as MultipartWrite<Part>>::Ret
type Output = <W as MultipartWrite<Part>>::Output
type Error = <W as MultipartWrite<Part>>::Error
fn poll_ready( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>
fn start_send( self: Pin<&mut Self>, part: Part, ) -> Result<Self::Ret, Self::Error>
fn poll_flush( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>
fn poll_complete( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<Self::Output, Self::Error>>
Implementors§
Source§impl<U, Wr, F, Part> MultipartWrite<Part> for Map<Wr, F>
impl<U, Wr, F, Part> MultipartWrite<Part> for Map<Wr, F>
Source§impl<U, Wr, F, Part> MultipartWrite<Part> for MapRet<Wr, F>
impl<U, Wr, F, Part> MultipartWrite<Part> for MapRet<Wr, F>
Source§impl<U, Wr, F, Part> MultipartWrite<U> for MapPart<Wr, F>
impl<U, Wr, F, Part> MultipartWrite<U> for MapPart<Wr, F>
type Ret = <Wr as MultipartWrite<Part>>::Ret
type Output = <Wr as MultipartWrite<Part>>::Output
type Error = <Wr as MultipartWrite<Part>>::Error
Source§impl<W: Write + Default> MultipartWrite<&[u8]> for MultiIoWriter<W>
impl<W: Write + Default> MultipartWrite<&[u8]> for MultiIoWriter<W>
Source§impl<W: AsyncWrite + Default + Unpin> MultipartWrite<&[u8]> for MultiAsyncWriter<W>
Available on crate feature tokio only.
impl<W: AsyncWrite + Default + Unpin> MultipartWrite<&[u8]> for MultiAsyncWriter<W>
tokio only.