eureka-mmanager 0.3.2

An Actix actor collection for downloading manga, chapters, covers from Mangadex
Documentation
use actix::prelude::*;
use mangadex_api::MangaDexClient;

use std::mem;

use crate::download::state::DownloadManagerState;

#[derive(Debug, Clone)]
pub struct UpdateClientMessage(pub MangaDexClient);

impl Message for UpdateClientMessage {
    type Result = MangaDexClient;
}

impl Handler<UpdateClientMessage> for DownloadManagerState {
    type Result = <UpdateClientMessage as Message>::Result;
    fn handle(&mut self, msg: UpdateClientMessage, _ctx: &mut Self::Context) -> Self::Result {
        mem::replace(&mut self.client, msg.0)
    }
}