feat(apb): added features from mastodon

This commit is contained in:
əlemi 2024-06-08 05:00:33 +02:00
parent 9e5740d6e4
commit ca83b17681
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -44,6 +44,8 @@ pub trait Actor : Object {
#[cfg(feature = "toot")] #[cfg(feature = "toot")]
fn discoverable(&self) -> Field<bool> { Err(FieldErr("discoverable")) } fn discoverable(&self) -> Field<bool> { Err(FieldErr("discoverable")) }
#[cfg(feature = "toot")]
fn featured(&self) -> Node<Self::Collection> { Node::Empty }
} }
pub trait Endpoints : Object { pub trait Endpoints : Object {
@ -95,6 +97,8 @@ pub trait ActorMut : ObjectMut {
#[cfg(feature = "toot")] #[cfg(feature = "toot")]
fn set_discoverable(self, val: Option<bool>) -> Self; fn set_discoverable(self, val: Option<bool>) -> Self;
#[cfg(feature = "toot")]
fn set_featured(self, val: Node<Self::Collection>) -> Self;
} }
pub trait EndpointsMut : ObjectMut { pub trait EndpointsMut : ObjectMut {
@ -147,6 +151,8 @@ impl Actor for serde_json::Value {
#[cfg(feature = "toot")] #[cfg(feature = "toot")]
crate::getter! { discoverable -> bool } crate::getter! { discoverable -> bool }
#[cfg(feature = "toot")]
crate::getter! { featured -> node Self::Collection }
} }
#[cfg(feature = "unstructured")] #[cfg(feature = "unstructured")]
@ -194,6 +200,8 @@ impl ActorMut for serde_json::Value {
#[cfg(feature = "toot")] #[cfg(feature = "toot")]
crate::setter! { discoverable -> bool } crate::setter! { discoverable -> bool }
#[cfg(feature = "toot")]
crate::setter! { featured -> node Self::Collection }
} }
#[cfg(feature = "unstructured")] #[cfg(feature = "unstructured")]