Define UserEvent
This commit is contained in:
parent
ad285898f6
commit
3b766fc427
@ -40,6 +40,7 @@ use rocket::{
|
||||
use std::{
|
||||
cmp::PartialEq,
|
||||
hash::{Hash, Hasher},
|
||||
sync::Arc,
|
||||
};
|
||||
use url::Url;
|
||||
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)]
|
||||
pub(crate) mod tests {
|
||||
use super::*;
|
||||
|
Loading…
Reference in New Issue
Block a user