pub fn new(config: Config, storage: S) -> Mailstrom<S>
    {
        let (sender, receiver) = mpsc::channel();

        let storage = Arc::new(RwLock::new(storage));

        let worker_status = Arc::new(RwLock::new(WorkerStatus::Ok as u8));

        let mut worker = Worker::new(
            receiver,
            Arc::clone(&storage),
            Arc::clone(&worker_status),
            config.clone(),
        );

        let _ = thread::spawn(move || {
            worker.run();
        });

        Mailstrom {
            config,
            sender,
            worker_status,
            storage,
        }
    }
/// Create a new Mailstrom instance for sending emails.
Create a new Mailstrom instance for sending emails.
Create a new Mailstrom instance for sending emails .
pub fn new(config: Config, storage: S) -> Mailstrom<S>
    {
        let (sender, receiver) = mpsc::channel();
        let storage = Arc::new(RwLock::new(storage));
        let worker_status = Arc::new(RwLock::new(WorkerStatus::Ok as u8));
        let mut worker = Worker::new(
            receiver,
            Arc::clone(&storage),
            Arc::clone(&worker_status),
            config.clone(),
        );
        let _ = thread::spawn(move || {
            worker.run();
        });
        Mailstrom {
            config,
            sender,
            worker_status,
            storage,
        }
    }
pub fn new ( config : Config , storage : S ) -> Mailstrom < S > { let ( sender , receiver ) = mpsc :: channel ( ) ; let storage = Arc :: new ( RwLock :: new ( storage ) ) ; let worker_status = Arc :: new ( RwLock :: new ( WorkerStatus :: Ok as u8 ) ) ; let mut worker = Worker :: new ( receiver , Arc :: clone ( & storage ) , Arc :: clone ( & worker_status ) , config . clone ( ) , ) ; let _ = thread :: spawn ( move | | { worker . run ( ) ; } ) ; Mailstrom { config , sender , worker_status , storage , } }
Create a new Mailstrom instance for sending emails.
Create a new Mailstrom instance for sending emails .
config
Config
storage
S
config
Config
storage
S