pub fn snapshot(&mut self) -> v8::StartupData {
    assert!(self.snapshot_creator.is_some());
    let state = Self::state(self.v8_isolate());

    // Note: create_blob() method must not be called from within a HandleScope.
    // TODO(piscisaureus): The rusty_v8 type system should enforce this.
    state.borrow_mut().global_context.take();

    self.inspector.take();

    // Overwrite existing ModuleMap to drop v8::Global handles
    self
      .v8_isolate()
      .set_slot(Rc::new(RefCell::new(ModuleMap::new(
        Rc::new(NoopModuleLoader),
        state.borrow().op_state.clone(),
      ))));
    // Drop other v8::Global handles before snapshotting
    std::mem::take(&mut state.borrow_mut().js_recv_cb);

    let snapshot_creator = self.snapshot_creator.as_mut().unwrap();
    let snapshot = snapshot_creator
      .create_blob(v8::FunctionCodeHandling::Keep)
      .unwrap();
    self.has_snapshotted = true;

    snapshot
  }
/// Takes a snapshot. The isolate should have been created with will_snapshot
/// set to true.
///
/// `AnyError` can be downcast to a type that exposes additional information
/// about the V8 exception. By default this type is `JsError`, however it may
/// be a different type if `RuntimeOptions::js_error_create_fn` has been set.
Takes a snapshot. The isolate should have been created with will_snapshot
set to true.

`AnyError` can be downcast to a type that exposes additional information
about the V8 exception. By default this type is `JsError`, however it may
be a different type if `RuntimeOptions::js_error_create_fn` has been set.
Takes a snapshot . The isolate should have been created with will_snapshot set to true . ` AnyError ` can be downcast to a type that exposes additional information about the V8 exception . By default this type is ` JsError ` however it may be a different type if ` RuntimeOptions :: js_error_create_fn ` has been set .
pub fn snapshot(&mut self) -> v8::StartupData {
    assert!(self.snapshot_creator.is_some());
    let state = Self::state(self.v8_isolate());
    // Note: create_blob() method must not be called from within a HandleScope.
    // TODO(piscisaureus): The rusty_v8 type system should enforce this.
    state.borrow_mut().global_context.take();
    self.inspector.take();
    // Overwrite existing ModuleMap to drop v8::Global handles
    self
      .v8_isolate()
      .set_slot(Rc::new(RefCell::new(ModuleMap::new(
        Rc::new(NoopModuleLoader),
        state.borrow().op_state.clone(),
      ))));
    // Drop other v8::Global handles before snapshotting
    std::mem::take(&mut state.borrow_mut().js_recv_cb);
    let snapshot_creator = self.snapshot_creator.as_mut().unwrap();
    let snapshot = snapshot_creator
      .create_blob(v8::FunctionCodeHandling::Keep)
      .unwrap();
    self.has_snapshotted = true;
    snapshot
  }
pub fn snapshot ( & mut self ) -> v8 :: StartupData { assert ! ( self snapshot_creator is_some ( ) ) ; let state = Self :: state ( self . v8_isolate ( ) ) ; // Note: create_blob() method must not be called from within a HandleScope. // TODO(piscisaureus): The rusty_v8 type system should enforce this. state . borrow_mut ( ) . global_context . take ( ) ; self . inspector . take ( ) ; // Overwrite existing ModuleMap to drop v8::Global handles self . v8_isolate ( ) . set_slot ( Rc :: new ( RefCell :: new ( ModuleMap :: new ( Rc :: new ( NoopModuleLoader ) , state . borrow ( ) . op_state . clone ( ) , ) ) ) ) ; // Drop other v8::Global handles before snapshotting std :: mem :: take ( & mut state . borrow_mut ( ) . js_recv_cb ) ; let snapshot_creator = self . snapshot_creator . as_mut ( ) . unwrap ( ) ; let snapshot = snapshot_creator . create_blob ( v8 :: FunctionCodeHandling :: Keep ) . unwrap ( ) ; self . has_snapshotted = true ; snapshot }
Takes a snapshot.
Takes a snapshot .
&mut self
&mut self