[][src]Struct rusty_v8::OwnedIsolate

pub struct OwnedIsolate { /* fields omitted */ }

Same as Isolate but gets disposed when it goes out of scope.

Methods from Deref<Target = Isolate>

pub fn thread_safe_handle(&mut self) -> IsolateHandle[src]

pub fn get_slot_mut<T: 'static>(&self) -> Option<RefMut<'_, T>>[src]

Get mutable reference to embedder data.

pub fn get_slot<T: 'static>(&self) -> Option<Ref<'_, T>>[src]

Get reference to embedder data.

pub fn set_slot<T: 'static>(&mut self, value: T) -> bool[src]

Use with Isolate::get_slot and Isolate::get_slot_mut to associate state with an Isolate.

This method gives ownership of value to the Isolate. Exactly one object of each type can be associated with an Isolate. If called more than once with an object of the same type, the earlier version will be dropped and replaced.

Returns true if value was set without replacing an existing value.

The value will be dropped when the isolate is dropped.

pub fn get_heap_statistics(&mut self, s: &mut HeapStatistics)[src]

Get statistics about the heap memory usage.

pub fn set_capture_stack_trace_for_uncaught_exceptions(
    &mut self,
    capture: bool,
    frame_limit: i32
)
[src]

Tells V8 to capture current stack trace when uncaught exception occurs and report it to the message listeners. The option is off by default.

pub fn add_message_listener(&mut self, callback: MessageCallback) -> bool[src]

Adds a message listener (errors only).

The same message listener can be added more than once and in that case it will be called more than once for each message.

The exception object will be passed to the callback.

pub fn set_promise_reject_callback(&mut self, callback: PromiseRejectCallback)[src]

Set callback to notify about promise reject with no handler, or revocation of such a previous notification once the handler is added.

pub fn set_host_initialize_import_meta_object_callback(
    &mut self,
    callback: HostInitializeImportMetaObjectCallback
)
[src]

This specifies the callback called by the upcoming importa.meta language feature to retrieve host-defined meta data for a module.

pub fn set_host_import_module_dynamically_callback(
    &mut self,
    callback: HostImportModuleDynamicallyCallback
)
[src]

This specifies the callback called by the upcoming dynamic import() language feature to load modules.

pub fn add_near_heap_limit_callback(
    &mut self,
    callback: NearHeapLimitCallback,
    data: *mut c_void
)
[src]

Add a callback to invoke in case the heap size is close to the heap limit. If multiple callbacks are added, only the most recently added callback is invoked.

pub fn remove_near_heap_limit_callback(
    &mut self,
    callback: NearHeapLimitCallback,
    heap_limit: usize
)
[src]

Remove the given callback and restore the heap limit to the given limit. If the given limit is zero, then it is ignored. If the current heap size is greater than the given limit, then the heap limit is restored to the minimal limit that is possible for the current heap size.

pub fn get_microtasks_policy(&self) -> MicrotasksPolicy[src]

Returns the policy controlling how Microtasks are invoked.

pub fn set_microtasks_policy(&mut self, policy: MicrotasksPolicy)[src]

Returns the policy controlling how Microtasks are invoked.

pub fn perform_microtask_checkpoint(&mut self)[src]

Runs the default MicrotaskQueue until it gets empty and perform other microtask checkpoint steps, such as calling ClearKeptObjects. Asserts that the MicrotasksPolicy is not kScoped. Any exceptions thrown by microtask callbacks are swallowed.

pub fn run_microtasks(&mut self)[src]

👎 Deprecated:

Use Isolate::perform_microtask_checkpoint() instead

An alias for PerformMicrotaskCheckpoint.

pub fn enqueue_microtask(&mut self, microtask: Local<'_, Function>)[src]

Enqueues the callback to the default MicrotaskQueue

pub fn take_heap_snapshot<F>(&mut self, callback: F) where
    F: FnMut(&[u8]) -> bool
[src]

Take a heap snapshot. The callback is invoked one or more times with byte slices containing the snapshot serialized as JSON. It's the callback's responsibility to reassemble them into a single document, e.g., by writing them to a file. Note that Chrome DevTools refuses to load snapshots without a .heapsnapshot suffix.

Trait Implementations

impl Deref for OwnedIsolate[src]

type Target = Isolate

The resulting type after dereferencing.

impl DerefMut for OwnedIsolate[src]

impl Drop for OwnedIsolate[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.