remove generic
This commit is contained in:
parent
2827ca3030
commit
d833d7d716
1 changed files with 3 additions and 4 deletions
|
|
@ -17,10 +17,10 @@ use tracing::debug;
|
||||||
/// Handles incoming activities, verifying HTTP signatures and other checks
|
/// Handles incoming activities, verifying HTTP signatures and other checks
|
||||||
///
|
///
|
||||||
/// After successful validation, activities are passed to respective [trait@ActivityHandler].
|
/// After successful validation, activities are passed to respective [trait@ActivityHandler].
|
||||||
pub async fn receive_activity<Activity, ActorT, Datatype, F, Fut>(
|
pub async fn receive_activity<Activity, ActorT, Datatype, Fut>(
|
||||||
request: HttpRequest,
|
request: HttpRequest,
|
||||||
body: Bytes,
|
body: Bytes,
|
||||||
hook: F,
|
hook: impl FnOnce(Activity, ActorT, Data<Datatype>) -> Fut,
|
||||||
data: &Data<Datatype>,
|
data: &Data<Datatype>,
|
||||||
) -> Result<HttpResponse, <Activity as ActivityHandler>::Error>
|
) -> Result<HttpResponse, <Activity as ActivityHandler>::Error>
|
||||||
where
|
where
|
||||||
|
|
@ -30,7 +30,6 @@ where
|
||||||
<Activity as ActivityHandler>::Error: From<Error> + From<<ActorT as Object>::Error>,
|
<Activity as ActivityHandler>::Error: From<Error> + From<<ActorT as Object>::Error>,
|
||||||
<ActorT as Object>::Error: From<Error>,
|
<ActorT as Object>::Error: From<Error>,
|
||||||
Datatype: Clone,
|
Datatype: Clone,
|
||||||
F: FnOnce(Activity, ActorT, Data<Datatype>) -> Fut,
|
|
||||||
Fut: Future<Output = Result<(), <Activity as ActivityHandler>::Error>>,
|
Fut: Future<Output = Result<(), <Activity as ActivityHandler>::Error>>,
|
||||||
{
|
{
|
||||||
let digest_header = request
|
let digest_header = request
|
||||||
|
|
@ -84,7 +83,7 @@ mod test {
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_receive_activity_hook() {
|
async fn test_receive_activity_hook() {
|
||||||
let (body, incoming_request, config) = setup_receive_test().await;
|
let (body, incoming_request, config) = setup_receive_test().await;
|
||||||
receive_activity::<Follow, DbUser, DbConnection, _, _>(
|
receive_activity::<Follow, DbUser, DbConnection, _>(
|
||||||
incoming_request.to_http_request(),
|
incoming_request.to_http_request(),
|
||||||
body,
|
body,
|
||||||
inbox_activity_hook,
|
inbox_activity_hook,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue