pub struct Pop3Builder { /* private fields */ }Expand description
Builder for POP3 messages (commands and replies).
Implementations§
Source§impl Pop3Builder
impl Pop3Builder
pub fn new() -> Self
Sourcepub fn ok_multiline(self, header: impl Into<String>, lines: Vec<String>) -> Self
pub fn ok_multiline(self, header: impl Into<String>, lines: Vec<String>) -> Self
Build a +OK response with a multi-line body.
The body is terminated by a .\r\n line automatically.
Sourcepub fn server_ready(self) -> Self
pub fn server_ready(self) -> Self
+OK POP3 server ready (server greeting).
Sourcepub fn user_accepted(self) -> Self
pub fn user_accepted(self) -> Self
+OK after successful USER.
Sourcepub fn stat_reply(self, num_msgs: u32, total_size: u64) -> Self
pub fn stat_reply(self, num_msgs: u32, total_size: u64) -> Self
+OK nmsgs octets (STAT response).
Sourcepub fn list_reply(self, messages: Vec<(u32, u64)>) -> Self
pub fn list_reply(self, messages: Vec<(u32, u64)>) -> Self
+OK with message list (LIST response, multi-line).
Sourcepub fn unknown_command(self) -> Self
pub fn unknown_command(self) -> Self
-ERR Unknown command.
Sourcepub fn permission_denied(self) -> Self
pub fn permission_denied(self) -> Self
-ERR Permission denied.
pub fn build(&self) -> Vec<u8> ⓘ
Trait Implementations§
Source§impl Clone for Pop3Builder
impl Clone for Pop3Builder
Source§fn clone(&self) -> Pop3Builder
fn clone(&self) -> Pop3Builder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Pop3Builder
impl Debug for Pop3Builder
Auto Trait Implementations§
impl Freeze for Pop3Builder
impl RefUnwindSafe for Pop3Builder
impl Send for Pop3Builder
impl Sync for Pop3Builder
impl Unpin for Pop3Builder
impl UnsafeUnpin for Pop3Builder
impl UnwindSafe for Pop3Builder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more