1
0
Fork 0
forked from alemi/upub

fix: actor type from json Value

This commit is contained in:
əlemi 2024-03-19 07:38:48 +01:00
parent ef54867369
commit 410b077fea
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -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<ActorType> {
match self.base_type()? {
BaseType::Object(ObjectType::Actor(x)) => Some(x),
_ => None,
}
}
}
impl Profile for serde_json::Value {