pub struct MountConfigBuilder {
pub mount_point: String,
pub dest_dir: String,
pub env: Vec<(String, String)>,
pub wasm_preload: bool,
pub disable_hydration: bool,
pub ssr_fetch_base: Option<String>,
pub ssr_cookies: Vec<String>,
pub pretty_html: bool,
}Fields§
§mount_point: String§dest_dir: String§env: Vec<(String, String)>§wasm_preload: bool§disable_hydration: bool§ssr_fetch_base: Option<String>§pretty_html: boolImplementations§
Source§impl MountConfigBuilder
impl MountConfigBuilder
pub fn new( mount_point: impl Into<String>, dest_dir: impl Into<String>, ) -> MountConfigBuilder
pub fn envs(self, envs: Vec<(String, String)>) -> Self
pub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn wasm_preload(self, wasm_preload: bool) -> Self
pub fn disable_hydration(self, disable_hydration: bool) -> Self
Sourcepub fn ssr_fetch_base(self, origin: impl Into<String>) -> Self
pub fn ssr_fetch_base(self, origin: impl Into<String>) -> Self
Origin against which SSR resolves relative fetch URLs (/api/posts), e.g. http://127.0.0.1:8080.
Without it, fetching a relative URL during SSR fails.
A cookie the app may read with get_driver().cookie_get() while the server renders the
page, f. ex. the language the user picked, so the page comes rendered as the browser will
show it. Others read as empty there, as they always did.
Only for a cookie the browser shows the app too: not HttpOnly. The Cookie header doesn’t
tell which are, and the server would render what the browser can’t.
Sourcepub fn pretty_html(self, pretty_html: bool) -> Self
pub fn pretty_html(self, pretty_html: bool) -> Self
Indent the server-rendered HTML, to read it in the page source.
Off by default: the indentation is whitespace between elements, which the app’s own tree doesn’t have - until the app starts it shows as gaps between inline elements, and hydration then takes it out, one node at a time.
pub fn build(self) -> Result<MountConfig, ErrorCode>
Auto Trait Implementations§
impl Freeze for MountConfigBuilder
impl RefUnwindSafe for MountConfigBuilder
impl Send for MountConfigBuilder
impl Sync for MountConfigBuilder
impl Unpin for MountConfigBuilder
impl UnsafeUnpin for MountConfigBuilder
impl UnwindSafe for MountConfigBuilder
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
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<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> ⓘ
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> ⓘ
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 more