Rename InnerClient to SmtpConnection
This commit is contained in:
@@ -79,7 +79,7 @@ fn escape_crlf(string: &str) -> String {
|
||||
|
||||
/// Structure that implements the SMTP client
|
||||
#[derive(Default)]
|
||||
pub struct InnerClient<S: Write + Read = NetworkStream> {
|
||||
pub struct SmtpConnection<S: Write + Read = NetworkStream> {
|
||||
/// TCP stream between client and server
|
||||
/// Value is None before connection
|
||||
stream: Option<BufStream<S>>,
|
||||
@@ -91,16 +91,16 @@ macro_rules! return_err (
|
||||
})
|
||||
);
|
||||
|
||||
impl<S: Write + Read> InnerClient<S> {
|
||||
impl<S: Write + Read> SmtpConnection<S> {
|
||||
/// Creates a new SMTP client
|
||||
///
|
||||
/// It does not connects to the server, but only creates the `Client`
|
||||
pub fn new() -> InnerClient<S> {
|
||||
InnerClient { stream: None }
|
||||
pub fn new() -> SmtpConnection<S> {
|
||||
SmtpConnection { stream: None }
|
||||
}
|
||||
}
|
||||
|
||||
impl<S: Connector + Write + Read + Timeout> InnerClient<S> {
|
||||
impl<S: Connector + Write + Read + Timeout> SmtpConnection<S> {
|
||||
/// Closes the SMTP transaction if possible
|
||||
pub fn close(&mut self) {
|
||||
let _ = self.command(QuitCommand);
|
||||
|
||||
@@ -19,7 +19,7 @@ use crate::{
|
||||
authentication::{
|
||||
Credentials, Mechanism, DEFAULT_ENCRYPTED_MECHANISMS, DEFAULT_UNENCRYPTED_MECHANISMS,
|
||||
},
|
||||
client::{net::ClientTlsParameters, InnerClient},
|
||||
client::{net::ClientTlsParameters, SmtpConnection},
|
||||
commands::*,
|
||||
error::{Error, SmtpResult},
|
||||
extension::{ClientId, Extension, MailBodyParameter, MailParameter, ServerInfo},
|
||||
@@ -258,7 +258,7 @@ pub struct SmtpTransport {
|
||||
/// Information about the client
|
||||
client_info: SmtpClient,
|
||||
/// Low level client
|
||||
client: InnerClient,
|
||||
client: SmtpConnection,
|
||||
}
|
||||
|
||||
macro_rules! try_smtp (
|
||||
@@ -281,7 +281,7 @@ impl<'a> SmtpTransport {
|
||||
///
|
||||
/// It does not connect to the server, but only creates the `SmtpTransport`
|
||||
pub fn new(builder: SmtpClient) -> SmtpTransport {
|
||||
let client = InnerClient::new();
|
||||
let client = SmtpConnection::new();
|
||||
|
||||
SmtpTransport {
|
||||
client,
|
||||
|
||||
Reference in New Issue
Block a user