2024-03-19 07:38:48 +01:00
|
|
|
use crate::{activitystream::{Base, BaseType}, strenum};
|
|
|
|
|
|
|
|
use super::ObjectType;
|
2024-03-19 05:15:41 +01:00
|
|
|
|
|
|
|
strenum! {
|
|
|
|
pub enum ActorType {
|
|
|
|
Application,
|
|
|
|
Group,
|
|
|
|
Organization,
|
|
|
|
Person,
|
|
|
|
Object
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub trait Profile : super::Object {
|
|
|
|
// not a Node because it's always embedded and one
|
|
|
|
fn describes(&self) -> Option<impl super::Object> { None::<serde_json::Value> }
|
|
|
|
}
|
|
|
|
|
|
|
|
pub trait Actor : super::Object {
|
|
|
|
fn actor_type(&self) -> Option<ActorType> { None }
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Actor for serde_json::Value {
|
2024-03-19 07:38:48 +01:00
|
|
|
fn actor_type(&self) -> Option<ActorType> {
|
|
|
|
match self.base_type()? {
|
|
|
|
BaseType::Object(ObjectType::Actor(x)) => Some(x),
|
|
|
|
_ => None,
|
|
|
|
}
|
|
|
|
}
|
2024-03-19 05:15:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Profile for serde_json::Value {
|
|
|
|
|
|
|
|
}
|