pub struct StreamingContext { /* private fields */ }Expand description
The context dioxus fullstack provides for the status of streaming responses on the server
Implementations§
Source§impl StreamingContext
impl StreamingContext
Sourcepub fn new(parts: Parts) -> Self
pub fn new(parts: Parts) -> Self
Create a new streaming context. You should not need to call this directly. Dioxus fullstack will provide this context for you.
Sourcepub fn commit_initial_chunk(&mut self)
pub fn commit_initial_chunk(&mut self)
Commit the initial chunk of the response. This will be called automatically if you are using the dioxus router when the suspense boundary above the router is resolved. Otherwise, you will need to call this manually to start the streaming part of the response.
Once this method has been called, the http response parts can no longer be modified.
Sourcepub fn current_status(&self) -> StreamingStatus
pub fn current_status(&self) -> StreamingStatus
Get the current status of the streaming response. This method is reactive and will cause the current reactive context to rerun when the status changes.
Sourcepub fn parts_mut(&self) -> RefMut<'_, Parts>
pub fn parts_mut(&self) -> RefMut<'_, Parts>
Access the http request parts mutably. This will allow you to modify headers and other parts of the request.
Sourcepub async fn extract<T: FromRequest<(), M>, M>() -> Result<T, ServerFnError>
pub async fn extract<T: FromRequest<(), M>, M>() -> Result<T, ServerFnError>
Extract an axum extractor from the current request. This will always use an empty body for the request,
since it’s assumed that rendering the app is done under a GET request.
Trait Implementations§
Source§impl Clone for StreamingContext
impl Clone for StreamingContext
Source§fn clone(&self) -> StreamingContext
fn clone(&self) -> StreamingContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more