Define UserEvent

This commit is contained in:
Kitaiti Makoto 2021-01-31 22:55:28 +09:00
parent ad285898f6
commit 3b766fc427

View File

@ -40,6 +40,7 @@ use rocket::{
use std::{ use std::{
cmp::PartialEq, cmp::PartialEq,
hash::{Hash, Hasher}, hash::{Hash, Hasher},
sync::Arc,
}; };
use url::Url; use url::Url;
use webfinger::*; use webfinger::*;
@ -1126,6 +1127,21 @@ impl NewUser {
} }
} }
#[derive(Clone, Debug)]
pub enum UserEvent {
RemoteUserFound(Arc<User>),
}
impl From<UserEvent> for Arc<User> {
fn from(event: UserEvent) -> Self {
use UserEvent::*;
match event {
RemoteUserFound(user) => user,
}
}
}
#[cfg(test)] #[cfg(test)]
pub(crate) mod tests { pub(crate) mod tests {
use super::*; use super::*;