Skip to content

Commit

Permalink
implemented actix multipart
Browse files Browse the repository at this point in the history
  • Loading branch information
sutantodadang committed Dec 14, 2024
1 parent e65969c commit b92ebc6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server_fn/src/request/actix.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{error::ServerFnError, request::Req};
use actix_web::{web::Payload, HttpRequest};
use bytes::Bytes;
use futures::Stream;
use futures::{Stream, StreamExt};
use send_wrapper::SendWrapper;
use std::{borrow::Cow, future::Future};

Expand Down Expand Up @@ -91,6 +91,10 @@ where
impl Stream<Item = Result<Bytes, ServerFnError>> + Send,
ServerFnError<CustErr>,
> {
Ok(futures::stream::once(async { todo!() }))
let payload = self.0.take().1;
let stream = payload.map(|res| {
res.map_err(|e| ServerFnError::Deserialization(e.to_string()))
});
Ok(SendWrapper::new(stream))
}
}

0 comments on commit b92ebc6

Please sign in to comment.