Nathan.fooo 6bb1c4e89c
feat: run rustfmt with custom defined fmt configuration (#1848)
* chore: update rustfmt

* chore: apply rustfmt format
2023-02-13 09:29:49 +08:00

21 lines
592 B
Rust

use crate::handlers::*;
use flowy_client_ws::FlowyWebSocketConnect;
use flowy_derive::{Flowy_Event, ProtoBuf_Enum};
use lib_dispatch::prelude::*;
use std::sync::Arc;
use strum_macros::Display;
pub fn init(ws_conn: Arc<FlowyWebSocketConnect>) -> AFPlugin {
AFPlugin::new()
.name("Flowy-Network")
.state(ws_conn)
.event(NetworkEvent::UpdateNetworkType, update_network_ty)
}
#[derive(Clone, Copy, PartialEq, Eq, Debug, Display, Hash, ProtoBuf_Enum, Flowy_Event)]
#[event_err = "FlowyError"]
pub enum NetworkEvent {
#[event(input = "NetworkStatePB")]
UpdateNetworkType = 0,
}