pub struct ServeOptsInner {Show 14 fields
pub host: String,
pub port: u16,
pub proxy: Vec<(String, String)>,
pub mount_point: String,
pub env: Vec<(String, String)>,
pub wasm_preload: bool,
pub disable_hydration: bool,
pub ssr_fetch_base: Option<String>,
pub ssr_cookie: Vec<String>,
pub ssr_fetch_cookie: Vec<String>,
pub pretty_html: bool,
pub disable_compression: bool,
pub precompress: bool,
pub threads: Option<usize>,
}Fields§
§host: String§port: u16§proxy: Vec<(String, String)>sets up proxy: --proxy /path=http://domain.com/path
Websockets under the path go through as well.
mount_point: StringDefine a mount point for the app in public url.
(For example an nginx’s location in which proxy_pass to the app was defined)
env: Vec<(String, String)>Setting the parameters --env api=http://domain.com/api --env api2=http://domain.com/api2
wasm_preload: boolWhether to start downloading and compiling WASM while the page loads, instead of after (at low priority, so images and styles take precedence)
disable_hydration: boolDisable hydration on page load (will re-create DOM instead of claiming existing nodes from SSR)
ssr_fetch_base: Option<String>Origin for resolving relative fetch URLs during SSR: --ssr-fetch-base http://127.0.0.1:8080
(default: this server’s address)
A cookie the app may read during SSR too, f. ex. the language the user picked:
--ssr-cookie lang --ssr-cookie theme
(only one the browser shows the app too, not HttpOnly: the server would render what the
browser can’t)
A cookie that goes out with the SSR fetches to this server’s own origin, f. ex. the session:
--ssr-fetch-cookie session
(default: all of them. Once one is named the others stay behind, and a visitor with only those is rendered as a guest, which a cache on the way may keep)
pretty_html: boolIndent the server-rendered HTML, to read it in the page source
(the indentation is whitespace between elements: until the app starts, it shows as gaps between inline ones, which hydration then takes out)
disable_compression: boolDisable gzip/brotli/zstd compression of served responses
(useful behind a proxy or CDN that already compresses)
precompress: boolCompress the wasm, wasm_run.js and other text files of the build with brotli at its
highest level once, at startup, for the browsers that accept brotli
(about a quarter smaller than compressing each response, for about a second of startup per megabyte)
threads: Option<usize>Number of threads to use for processing requests
(default: number of CPU cores, 2 for watch mode)
Trait Implementations§
Source§impl Args for ServeOptsInner
impl Args for ServeOptsInner
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl Clone for ServeOptsInner
impl Clone for ServeOptsInner
Source§impl Debug for ServeOptsInner
impl Debug for ServeOptsInner
Source§impl FromArgMatches for ServeOptsInner
impl FromArgMatches for ServeOptsInner
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Auto Trait Implementations§
impl Forget for ServeOptsInner
impl Freeze for ServeOptsInner
impl Move for ServeOptsInner
impl RefUnwindSafe for ServeOptsInner
impl Send for ServeOptsInner
impl Sync for ServeOptsInner
impl Unpin for ServeOptsInner
impl UnsafeUnpin for ServeOptsInner
impl UnwindSafe for ServeOptsInner
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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