Struct vsmtp_protocol::Receiver
pub struct Receiver<T: ReceiverHandler + Send, V: Validation + Send, W: AsyncWrite + Unpin + Send, R: AsyncRead + Unpin + Send>where
V::Value: Send + Sync,{ /* private fields */ }Expand description
A SMTP receiver.
Implementations§
§impl<T: ReceiverHandler + Send, V: Validation + Send> Receiver<T, V, OwnedWriteHalf, OwnedReadHalf>where
V::Value: Send + Sync,
impl<T: ReceiverHandler + Send, V: Validation + Send> Receiver<T, V, OwnedWriteHalf, OwnedReadHalf>where V::Value: Send + Sync,
pub fn new(
tcp_stream: TcpStream,
kind: ConnectionKind,
handler: T,
threshold_soft_error: i64,
threshold_hard_error: i64,
message_size_max: usize
) -> Self
pub fn new( tcp_stream: TcpStream, kind: ConnectionKind, handler: T, threshold_soft_error: i64, threshold_hard_error: i64, message_size_max: usize ) -> Self
Create a new Receiver from a TCP/IP stream.
pub fn into_stream(
self,
client_addr: SocketAddr,
server_addr: SocketAddr,
timestamp: OffsetDateTime,
uuid: Uuid
) -> impl Stream<Item = Result<()>>
pub fn into_stream( self, client_addr: SocketAddr, server_addr: SocketAddr, timestamp: OffsetDateTime, uuid: Uuid ) -> impl Stream<Item = Result<()>>
Handle the inner stream to produce a [tokio_stream::Stream], each item
being a successful SMTP transaction.
Panics
- if the
ReceiverHandler::on_accept()produces amessageor aauthenticateoutcome (which is invalid)