ActivityExt

Trait ActivityExt 

Source
pub trait ActivityExt: Activity {
    type ActorId: Dereference + From<Url>;
    type ObjectId: Dereference + From<Url>;

    // Required methods
    fn actor(&self) -> Option<Out<Self::ActorId>>;
    fn object(&self) -> Option<Out<Self::ObjectId>>;

    // Provided methods
    fn dereference_actor<'life0, 'async_trait, I, R, S>(
        &'life0 self,
        actor_id: I::ActorId,
        ingest: I,
        remote_repo: R,
        session: S,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Out<Self::ActorId>>, I::Error>> + 'async_trait>>
       where I::Error: From<R::Error>,
             I::ActorId: From<Url> + 'static,
             I: 'async_trait + Ingest<Out<Self::ActorId>>,
             R: 'async_trait + Repo,
             S: 'async_trait + Session,
             Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn dereference_object<'life0, 'async_trait, I, R, S>(
        &'life0 self,
        actor_id: I::ActorId,
        ingest: I,
        remote_repo: R,
        session: S,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Out<Self::ObjectId>>, I::Error>> + 'async_trait>>
       where I::Error: From<R::Error>,
             I::ActorId: From<Url> + 'static,
             I: 'async_trait + Ingest<Out<Self::ObjectId>>,
             R: 'async_trait + Repo,
             S: 'async_trait + Session,
             Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

An extension of Activity that is aware of it’s Actor and Object types

Required Associated Types§

Source

type ActorId: Dereference + From<Url>

The Actor ID type for dereferencing an Actor

Source

type ObjectId: Dereference + From<Url>

The Object ID type for dereferencing an Object

Required Methods§

Source

fn actor(&self) -> Option<Out<Self::ActorId>>

Attempt to pull the actor off the activity

Source

fn object(&self) -> Option<Out<Self::ObjectId>>

Attempt to pull the object off the activity

Provided Methods§

Source

fn dereference_actor<'life0, 'async_trait, I, R, S>( &'life0 self, actor_id: I::ActorId, ingest: I, remote_repo: R, session: S, ) -> Pin<Box<dyn Future<Output = Result<Option<Out<Self::ActorId>>, I::Error>> + 'async_trait>>
where I::Error: From<R::Error>, I::ActorId: From<Url> + 'static, I: 'async_trait + Ingest<Out<Self::ActorId>>, R: 'async_trait + Repo, S: 'async_trait + Session, Self: 'async_trait, 'life0: 'async_trait,

Pull the actor off the activity, or fetch it from a repo if it isn’t present

Source

fn dereference_object<'life0, 'async_trait, I, R, S>( &'life0 self, actor_id: I::ActorId, ingest: I, remote_repo: R, session: S, ) -> Pin<Box<dyn Future<Output = Result<Option<Out<Self::ObjectId>>, I::Error>> + 'async_trait>>
where I::Error: From<R::Error>, I::ActorId: From<Url> + 'static, I: 'async_trait + Ingest<Out<Self::ObjectId>>, R: 'async_trait + Repo, S: 'async_trait + Session, Self: 'async_trait, 'life0: 'async_trait,

Pull the object off the activity, or fetch it from a repo if it isn’t present

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a, T> ActivityExt for &'a T
where T: ActivityExt,

Source§

impl<'a, T> ActivityExt for &'a mut T
where T: ActivityExt,

Source§

impl<T> ActivityExt for Box<T>
where T: ActivityExt,

Source§

impl<T> ActivityExt for Rc<T>
where T: ActivityExt,

Source§

impl<T> ActivityExt for Arc<T>
where T: ActivityExt,

Implementors§