pub struct JsServer { /* private fields */ }
Implementations§
Source§impl JsServer
impl JsServer
Sourcepub fn new<T: Serialize>(
base_dir: impl Into<PathBuf>,
index_html: impl Into<String>,
opts: T,
max_threads: usize,
) -> Self
pub fn new<T: Serialize>( base_dir: impl Into<PathBuf>, index_html: impl Into<String>, opts: T, max_threads: usize, ) -> Self
this module should export { render } (which takes a SsrRequest) and should return a SsrResponse
threads: how many concurrent js instances can exist
§Panics if opts cannot be serialized to serde_json::Value
Sourcepub async fn route_internally(&self, pit: FirePit)
pub async fn route_internally(&self, pit: FirePit)
Call this if you wan’t to route requests internally without going over the http stack
You need to pass a FirePit
pub async fn request(&self, req: &mut Request) -> Result<Response, Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JsServer
impl RefUnwindSafe for JsServer
impl Send for JsServer
impl Sync for JsServer
impl Unpin for JsServer
impl UnwindSafe for JsServer
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
Mutably borrows from an owned value. Read more