AppFlowy/frontend/rust-lib/flowy-user/src/event.rs

31 lines
756 B
Rust
Raw Normal View History

use flowy_derive::{Flowy_Event, ProtoBuf_Enum};
2021-08-30 14:44:17 +00:00
use strum_macros::Display;
#[derive(Clone, Copy, PartialEq, Eq, Debug, Display, Hash, ProtoBuf_Enum, Flowy_Event)]
#[event_err = "UserError"]
pub enum UserEvent {
#[event()]
2021-12-04 14:24:32 +00:00
InitUser = 0,
2021-08-30 14:44:17 +00:00
2021-09-04 08:53:58 +00:00
#[event(input = "SignInRequest", output = "UserProfile")]
2021-12-04 14:24:32 +00:00
SignIn = 1,
2021-08-30 14:44:17 +00:00
2021-09-04 08:53:58 +00:00
#[event(input = "SignUpRequest", output = "UserProfile")]
2021-12-04 14:24:32 +00:00
SignUp = 2,
2021-08-30 14:44:17 +00:00
#[event(passthrough)]
2021-12-04 14:24:32 +00:00
SignOut = 3,
2021-08-30 14:44:17 +00:00
2021-08-31 15:01:46 +00:00
#[event(input = "UpdateUserRequest")]
2021-12-04 14:24:32 +00:00
UpdateUser = 4,
2021-09-17 11:03:46 +00:00
#[event(output = "UserProfile")]
2021-12-04 14:24:32 +00:00
GetUserProfile = 5,
#[event(output = "UserProfile")]
2021-12-04 14:24:32 +00:00
CheckUser = 6,
#[event(input = "NetworkState")]
UpdateNetworkType = 10,
}