diff --git a/src/activitystream/object/actor.rs b/src/activitystream/object/actor.rs index b39dede0..a89ea640 100644 --- a/src/activitystream/object/actor.rs +++ b/src/activitystream/object/actor.rs @@ -1,4 +1,6 @@ -use crate::strenum; +use crate::{activitystream::{Base, BaseType}, strenum}; + +use super::ObjectType; strenum! { pub enum ActorType { @@ -20,7 +22,12 @@ pub trait Actor : super::Object { } impl Actor for serde_json::Value { - + fn actor_type(&self) -> Option { + match self.base_type()? { + BaseType::Object(ObjectType::Actor(x)) => Some(x), + _ => None, + } + } } impl Profile for serde_json::Value {