pub struct StreamingJson;
Expand description
An encoding that represents a stream of JSON data.
A server function that uses this as its output encoding should return StreamingJson
§Browser Support for Streaming Input
Browser fetch requests do not currently support full request duplexing, which means that that they do begin handling responses until the full request has been sent. This means that if you use a streaming input encoding, the input stream needs to end before the output will begin.
Streaming requests are only allowed over HTTP2 or HTTP3.
Trait Implementations§
Source§impl Encoding for StreamingJson
impl Encoding for StreamingJson
Source§impl<CustErr, T, S, Request> FromReq<StreamingJson, Request, CustErr> for Swhere
Request: Req<CustErr> + Send + 'static,
S: Stream<Item = T> + From<JsonStream<T>> + Send + 'static,
T: DeserializeOwned + 'static,
impl<CustErr, T, S, Request> FromReq<StreamingJson, Request, CustErr> for Swhere
Request: Req<CustErr> + Send + 'static,
S: Stream<Item = T> + From<JsonStream<T>> + Send + 'static,
T: DeserializeOwned + 'static,
Source§async fn from_req(req: Request) -> Result<S, ServerFnError<CustErr>>
async fn from_req(req: Request) -> Result<S, ServerFnError<CustErr>>
Attempts to deserialize the arguments from a request.
Source§impl<CustErr, T, Response> FromRes<StreamingJson, Response, CustErr> for JsonStream<T>
impl<CustErr, T, Response> FromRes<StreamingJson, Response, CustErr> for JsonStream<T>
Source§async fn from_res(
res: Response,
) -> Result<JsonStream<T>, ServerFnError<CustErr>>
async fn from_res( res: Response, ) -> Result<JsonStream<T>, ServerFnError<CustErr>>
Attempts to deserialize the outputs from a response.
Source§impl<CustErr, T, Response> IntoRes<StreamingJson, Response, CustErr> for JsonStream<T, CustErr>
impl<CustErr, T, Response> IntoRes<StreamingJson, Response, CustErr> for JsonStream<T, CustErr>
Source§async fn into_res(self) -> Result<Response, ServerFnError<CustErr>>
async fn into_res(self) -> Result<Response, ServerFnError<CustErr>>
Attempts to serialize the output into an HTTP response.
Auto Trait Implementations§
impl Freeze for StreamingJson
impl RefUnwindSafe for StreamingJson
impl Send for StreamingJson
impl Sync for StreamingJson
impl Unpin for StreamingJson
impl UnwindSafe for StreamingJson
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<CustErr, S, T, Request> IntoReq<StreamingJson, Request, CustErr> for S
impl<CustErr, S, T, Request> IntoReq<StreamingJson, Request, CustErr> for S
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.