pub struct ServerRenderer<COMP>where
COMP: BaseComponent,{ /* private fields */ }
Available on crate feature
ssr
only.Expand description
A Yew Server-side Renderer.
This renderer spawns the rendering task to a Yew Runtime
. and receives result when
the rendering process has finished.
See yew::platform
for more information.
Implementations§
Source§impl<COMP> ServerRenderer<COMP>
impl<COMP> ServerRenderer<COMP>
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a ServerRenderer with default properties.
Source§impl<COMP> ServerRenderer<COMP>where
COMP: BaseComponent,
impl<COMP> ServerRenderer<COMP>where
COMP: BaseComponent,
Sourcepub fn with_props<F>(create_props: F) -> Self
pub fn with_props<F>(create_props: F) -> Self
Creates a ServerRenderer with custom properties.
§Note
The properties does not have to implement Send
.
However, the function to create properties needs to be Send
.
Sourcepub fn with_runtime(self, rt: Runtime) -> Self
pub fn with_runtime(self, rt: Runtime) -> Self
Sets the runtime the ServerRenderer will run the rendering task with.
Sourcepub fn hydratable(self, val: bool) -> Self
pub fn hydratable(self, val: bool) -> Self
Sets whether an the rendered result is hydratable.
Defaults to true
.
When this is sets to true
, the rendered artifact will include additional information
to assist with the hydration process.
Sourcepub async fn render_to_string(self, w: &mut String)
pub async fn render_to_string(self, w: &mut String)
Renders Yew Application to a String.
Sourcepub fn render_stream(self) -> impl Send + Stream<Item = String>
pub fn render_stream(self) -> impl Send + Stream<Item = String>
Renders Yew Application into a string Stream.
Trait Implementations§
Source§impl<COMP> Debug for ServerRenderer<COMP>where
COMP: BaseComponent,
impl<COMP> Debug for ServerRenderer<COMP>where
COMP: BaseComponent,
Source§impl<COMP> Default for ServerRenderer<COMP>
impl<COMP> Default for ServerRenderer<COMP>
Auto Trait Implementations§
impl<COMP> Freeze for ServerRenderer<COMP>
impl<COMP> !RefUnwindSafe for ServerRenderer<COMP>
impl<COMP> Send for ServerRenderer<COMP>
impl<COMP> !Sync for ServerRenderer<COMP>
impl<COMP> Unpin for ServerRenderer<COMP>
impl<COMP> !UnwindSafe for ServerRenderer<COMP>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self
to a value of a Properties
struct.Source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self
to a value of a Properties
struct.