Struct perseus_axum::ServerOptions
source · [−]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/static
in 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
Auto Trait Implementations
impl !RefUnwindSafe for ServerOptions
impl Send for ServerOptions
impl Sync for ServerOptions
impl Unpin for ServerOptions
impl !UnwindSafe for ServerOptions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more