From 3b766fc427ed755039257e11586ce06b877ce2c1 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Sun, 31 Jan 2021 22:55:28 +0900 Subject: [PATCH] Define UserEvent --- plume-models/src/users.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/plume-models/src/users.rs b/plume-models/src/users.rs index 9b1745ad..52ae57ef 100644 --- a/plume-models/src/users.rs +++ b/plume-models/src/users.rs @@ -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), +} + +impl From for Arc { + fn from(event: UserEvent) -> Self { + use UserEvent::*; + + match event { + RemoteUserFound(user) => user, + } + } +} + #[cfg(test)] pub(crate) mod tests { use super::*;