mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-22 19:41:03 +00:00
Define UserEvent
This commit is contained in:
parent
ad285898f6
commit
3b766fc427
1 changed files with 16 additions and 0 deletions
|
@ -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 a new issue