pub struct ServerOptions {
    pub js_bundle: String,
    pub wasm_bundle: String,
    pub wasm_js_bundle: String,
    pub html_shell: HtmlShell,
    pub templates_map: HashMap<String, Arc<Template<SsrNode>>, RandomState>,
    pub locales: Locales,
    pub root_id: String,
    pub snippets: String,
    pub error_pages: ErrorPages<SsrNode>,
    pub static_dir: Option<String>,
    pub static_aliases: HashMap<String, String, RandomState>,
}
Expand description

The options for setting up all server integrations. This should be literally constructed, as nothing is optional. If integrations need further properties, they should expose their own options in addition to these. These should be accessed through an Arc/Rc for integration developers.

Fields

js_bundle: String

The location on the filesystem of your JavaScript bundle.

wasm_bundle: String

The location on the filesystem of your Wasm bundle.

wasm_js_bundle: String

The location on the filesystem of your JS bundle converted from your Wasm bundle. This isn’t required, and if you haven’t generated this, you should provide a fake path.

html_shell: HtmlShell

The HTML shell to interpolate Perseus into.

templates_map: HashMap<String, Arc<Template<SsrNode>>, RandomState>

A HashMap of your app’s templates by their paths.

locales: Locales

The locales information for the app.

root_id: String

The HTML id of the element at which to render Perseus. On the server-side, interpolation will be done here in a highly efficient manner by not parsing the HTML, so this MUST be of the form <div id="root_id"> in your markup (double or single quotes, root_id replaced by what this property is set to).

snippets: String

The location of the JS interop snippets to be served as static files.

error_pages: ErrorPages<SsrNode>

The error pages for the app. These will be server-rendered if an initial load fails.

static_dir: Option<String>

The directory to serve static content from, which will be mapped to /.perseus/staticin the browser.

static_aliases: HashMap<String, String, RandomState>

A map of URLs to act as aliases for certain static resources. These are particularly designed for things like a site manifest or favicons, which should be stored in a static directory, but need to be aliased at a path like /favicon.ico.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more