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
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,
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,
Converts an object from ActivityPub type to Lemmy internal type.
apub
The object to read fromcontext
LemmyContext which holds DB pool, HTTP client etcexpected_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, ignoreexpected_domain
in this case
Implementations on Foreign Types
fn from_apub<'life0, 'life1, 'life2, 'life3, 'async_trait>(
note: &'life0 Note,
context: &'life1 LemmyContext,
expected_domain: &'life2 Url,
request_counter: &'life3 mut i32
) -> Pin<Box<dyn Future<Output = Result<Comment, LemmyError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn from_apub<'life0, 'life1, 'life2, 'life3, 'async_trait>(
note: &'life0 Note,
context: &'life1 LemmyContext,
expected_domain: &'life2 Url,
request_counter: &'life3 mut i32
) -> Pin<Box<dyn Future<Output = Result<Comment, LemmyError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Converts a Note
to Comment
.
If the parent community, post and comment(s) are not known locally, these are also fetched.
type ApubType = Note
fn from_apub<'life0, 'life1, 'life2, 'life3, 'async_trait>(
group: &'life0 Group,
context: &'life1 LemmyContext,
expected_domain: &'life2 Url,
request_counter: &'life3 mut i32
) -> Pin<Box<dyn Future<Output = Result<Community, LemmyError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn from_apub<'life0, 'life1, 'life2, 'life3, 'async_trait>(
group: &'life0 Group,
context: &'life1 LemmyContext,
expected_domain: &'life2 Url,
request_counter: &'life3 mut i32
) -> Pin<Box<dyn Future<Output = Result<Community, LemmyError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Converts a Group
to Community
, inserts it into the database and updates moderators.