pub struct ImapSend<T: Encoder> { /* private fields */ }Expand description
I/O-free coroutine sending one IMAP command and parsing its response.
Implementations§
Source§impl<T: Encoder> ImapSend<T>
impl<T: Encoder> ImapSend<T>
Sourcepub fn new(encoder: T, message: T::Message<'static>) -> Self
pub fn new(encoder: T, message: T::Message<'static>) -> Self
Builds a send serialising message through encoder and
parsing its response.
Sourcepub fn receive(message: T::Message<'static>) -> Self
pub fn receive(message: T::Message<'static>) -> Self
Receive-only: skips serialisation and parses the response of a request whose bytes were written out of band.
Used by the streamed APPEND literal; message is echoed back
unchanged in the Ok output.
Sourcepub fn resume(
&mut self,
fragmentizer: &mut Fragmentizer,
arg: Option<&[u8]>,
) -> ImapSendResult<T>
pub fn resume( &mut self, fragmentizer: &mut Fragmentizer, arg: Option<&[u8]>, ) -> ImapSendResult<T>
Pass None initially or after WantsWrite, Some(bytes)
after WantsRead, Some(&[]) on EOF.
Trait Implementations§
Source§impl<T: Encoder> ImapCoroutine for ImapSend<T>
impl<T: Encoder> ImapCoroutine for ImapSend<T>
Source§type Return = Result<ImapSendOutput<T>, ImapSendError>
type Return = Result<ImapSendOutput<T>, ImapSendError>
The final value produced on completion.
Source§fn resume(
&mut self,
fragmentizer: &mut Fragmentizer,
arg: Option<&[u8]>,
) -> ImapCoroutineState<Self::Yield, Self::Return>
fn resume( &mut self, fragmentizer: &mut Fragmentizer, arg: Option<&[u8]>, ) -> ImapCoroutineState<Self::Yield, Self::Return>
Pass
None initially or after a WantsWrite, Some(bytes)
after a WantsRead, Some(&[]) on EOF.Auto Trait Implementations§
impl<T> Freeze for ImapSend<T>
impl<T> RefUnwindSafe for ImapSend<T>
impl<T> Send for ImapSend<T>
impl<T> Sync for ImapSend<T>
impl<T> Unpin for ImapSend<T>
impl<T> UnsafeUnpin for ImapSend<T>
impl<T> UnwindSafe for ImapSend<T>
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