Struct ssr::SsrConfig

source ·
pub struct SsrConfig {
    pub port: u16,
    pub js_worker: PathBuf,
    pub js_worker_log: JsWorkerLog,
    pub global_js_renderer: Option<PathBuf>,
}
Expand description

A global configuration for Ssr instance.

Fields§

§port: u16

A port that Node.js worker will be listening on.

§js_worker: PathBuf

Path to Node.js worker installed from npm. It should be relative to the std::env::current_dir.

§js_worker_log: JsWorkerLog

Log verbosity of Node.js worker.

§global_js_renderer: Option<PathBuf>

If your web app is a SPA (Single Page Application), then you should have a single entry point for all rendering requests. If it’s the case, provide a path to this file here and it will be used by the worker to render all responses. Another option is to provide a JS renderer per request but keep in mind that it would introduce additional runtime overhead since JS module has to be required during a request as opposed to requiring it once on application startup.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.