pub struct Server { /* private fields */ }Expand description
Represents the main SMTP server instance.
Holds the application configuration and a shared WebhookClient instance
used by connection handlers to forward processed emails.
Implementations§
Source§impl Server
impl Server
Sourcepub fn new(config: Config) -> Self
pub fn new(config: Config) -> Self
Creates a new SMTP Server instance.
Initializes the shared WebhookClient.
§Arguments
config- The application configuration.
Sourcepub async fn run(&self) -> Result<()>
pub async fn run(&self) -> Result<()>
Runs the main SMTP server loop.
Binds to the configured SMTP address and port, then enters an infinite loop
accepting incoming TCP connections. Each connection is handled in a separate
Tokio task via handle_connection.
§Errors
Returns an Err if the server fails to bind to the specified address and port.
Errors during connection acceptance or handling are logged but do not terminate the server loop.
Auto Trait Implementations§
impl Freeze for Server
impl !RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl !UnwindSafe for Server
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