Trait lemmy_apub::objects::FromApub[][src]

pub trait FromApub {
    type ApubType;
    fn from_apub<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        apub: &'life0 Self::ApubType,
        context: &'life1 LemmyContext,
        expected_domain: &'life2 Url,
        request_counter: &'life3 mut i32
    ) -> Pin<Box<dyn Future<Output = Result<Self, LemmyError>> + 'async_trait>>
    where
        Self: Sized,
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        'life3: 'async_trait,
        Self: 'async_trait
; }

Associated Types

Required methods

Converts an object from ActivityPub type to Lemmy internal type.

  • apub The object to read from
  • context LemmyContext which holds DB pool, HTTP client etc
  • expected_domain Domain where the object was received from. None in case of mod action.
  • mod_action_allowed True if the object can be a mod activity, ignore expected_domain in this case

Implementations on Foreign Types

Converts a Note to Comment.

If the parent community, post and comment(s) are not known locally, these are also fetched.

Converts a Group to Community, inserts it into the database and updates moderators.

impl FromApub for Post

Implementors