Struct dioxus_fullstack::ServeConfigBuilder
source · pub struct ServeConfigBuilder { /* private fields */ }Expand description
A ServeConfig is used to configure how to serve a Dioxus application. It contains information about how to serve static assets, and what content to render with [dioxus-ssr].
Implementations§
source§impl ServeConfigBuilder
impl ServeConfigBuilder
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new ServeConfigBuilder with the root component and props to render on the server.
sourcepub fn incremental(self, cfg: IncrementalRendererConfig) -> Self
pub fn incremental(self, cfg: IncrementalRendererConfig) -> Self
Enable incremental static generation
sourcepub fn index_html(self, index_html: String) -> Self
pub fn index_html(self, index_html: String) -> Self
Set the contents of the index.html file to be served. (precedence over index_path)
sourcepub fn index_path(self, index_path: PathBuf) -> Self
pub fn index_path(self, index_path: PathBuf) -> Self
Set the path of the index.html file to be served. (defaults to {assets_path}/index.html)
sourcepub fn root_id(self, root_id: &'static str) -> Self
pub fn root_id(self, root_id: &'static str) -> Self
Set the id of the root element in the index.html file to place the prerendered content into. (defaults to main)
sourcepub fn build(self) -> ServeConfig
pub fn build(self) -> ServeConfig
Build the ServeConfig
Trait Implementations§
source§impl Clone for ServeConfigBuilder
impl Clone for ServeConfigBuilder
source§fn clone(&self) -> ServeConfigBuilder
fn clone(&self) -> ServeConfigBuilder
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Default for ServeConfigBuilder
impl Default for ServeConfigBuilder
source§fn default() -> ServeConfigBuilder
fn default() -> ServeConfigBuilder
Returns the “default value” for a type. Read more
source§impl From<ServeConfigBuilder> for ServeConfig
impl From<ServeConfigBuilder> for ServeConfig
source§fn from(builder: ServeConfigBuilder) -> Self
fn from(builder: ServeConfigBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ServeConfigBuilder
impl !RefUnwindSafe for ServeConfigBuilder
impl Send for ServeConfigBuilder
impl Sync for ServeConfigBuilder
impl Unpin for ServeConfigBuilder
impl !UnwindSafe for ServeConfigBuilder
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.