Struct vsmtp_server::Connection
[−]pub struct Connection<S>where
S: AsyncRead + AsyncWrite + Send + Unpin + Debug,{
pub kind: ConnectionKind,
pub context: ConnectionContext,
pub config: Arc<Config>,
pub inner: AbstractIO<S>,
}Expand description
Instance containing connection to the server’s information
Fields
kind: ConnectionKindKind of connection
context: ConnectionContextData related to this connection
config: Arc<Config>server’s configuration
inner: AbstractIO<S>inner stream
Implementations
impl<S> Connection<S>where
S: AsyncRead + AsyncWrite + Send + Unpin + Debug,
impl<S> Connection<S>where
S: AsyncRead + AsyncWrite + Send + Unpin + Debug,
pub fn new(
kind: ConnectionKind,
client_addr: SocketAddr,
server_addr: SocketAddr,
config: Arc<Config>,
inner: S
) -> Self
pub fn new(
kind: ConnectionKind,
client_addr: SocketAddr,
server_addr: SocketAddr,
config: Arc<Config>,
inner: S
) -> Self
impl<S> Connection<S>where
S: AsyncRead + AsyncWrite + Send + Unpin + Debug,
impl<S> Connection<S>where
S: AsyncRead + AsyncWrite + Send + Unpin + Debug,
pub async fn send_reply_or_code(
&mut self,
reply_or_code: ReplyOrCodeID
) -> Result<()>
pub async fn send_reply_or_code(
&mut self,
reply_or_code: ReplyOrCodeID
) -> Result<()>
pub async fn send_reply(&mut self, reply: Reply) -> Result<()>
pub async fn send_reply(&mut self, reply: Reply) -> Result<()>
send a reply code to the client
Errors
impl<S> Connection<S>where
S: AsyncRead + AsyncWrite + Send + Unpin + Sync + Debug,
impl<S> Connection<S>where
S: AsyncRead + AsyncWrite + Send + Unpin + Sync + Debug,
pub async fn receive<M>(
&mut self,
tls_config: Option<Arc<ServerConfig>>,
rule_engine: Arc<RuleEngine>,
resolvers: Arc<DnsResolvers>,
queue_manager: Arc<dyn GenericQueueManager>,
mail_handler: &mut M
) -> Result<()>where
M: OnMail + Send,
pub async fn receive<M>(
&mut self,
tls_config: Option<Arc<ServerConfig>>,
rule_engine: Arc<RuleEngine>,
resolvers: Arc<DnsResolvers>,
queue_manager: Arc<dyn GenericQueueManager>,
mail_handler: &mut M
) -> Result<()>where
M: OnMail + Send,
Receives the incomings mail of a connection
Errors
- server failed to send a message
- a transaction failed
- the pre-queue processing of the mail failed
Trait Implementations
Auto Trait Implementations
impl<S> !RefUnwindSafe for Connection<S>
impl<S> Send for Connection<S>
impl<S> Sync for Connection<S>where
S: Sync,
impl<S> Unpin for Connection<S>
impl<S> !UnwindSafe for Connection<S>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more