pub struct Ssr<'s, 'i> { /* private fields */ }Implementations§
source§impl<'s, 'i> Ssr<'s, 'i>where
's: 'i,
impl<'s, 'i> Ssr<'s, 'i>where
's: 'i,
sourcepub fn create_platform()
pub fn create_platform()
Initialize a V8 js engine instance. It’s mandatory to call it before any call to V8. The Ssr module needs this function call before any other operation.
sourcepub fn from(
source: String,
entry_point: &str,
) -> Result<Ssr<'s, 'i>, &'static str>
pub fn from( source: String, entry_point: &str, ) -> Result<Ssr<'s, 'i>, &'static str>
It creates a new SSR instance.
This function is expensive and it should be called as less as possible.
Even though V8 allows multiple threads the Ssr struct created with this call can be accessed by just the thread that created it.
Multiple instances are allowed.
Entry point is the JS element that the bundler exposes. It has to be an empty string in case the bundle is exported as IIFE.
Check the examples vite-react (for the IIFE example) and webpack-react (for the bundle exported as variable).
See the examples folder for more about using multiple parallel instances for multi-threaded execution.
Trait Implementations§
Auto Trait Implementations§
impl<'s, 'i> Freeze for Ssr<'s, 'i>
impl<'s, 'i> !RefUnwindSafe for Ssr<'s, 'i>
impl<'s, 'i> !Send for Ssr<'s, 'i>
impl<'s, 'i> !Sync for Ssr<'s, 'i>
impl<'s, 'i> Unpin for Ssr<'s, 'i>
impl<'s, 'i> !UnwindSafe for Ssr<'s, 'i>
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