mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-26 21:41:04 +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::{
|
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::*;
|
||||||
|
|
Loading…
Reference in a new issue