[]Struct qjs::RuntimeRef

pub struct RuntimeRef(_);

A borrowed reference to a Runtime.

Methods

impl RuntimeRef[src]

pub fn free_atom(&self, atom: JSAtom)[src]

impl RuntimeRef[src]

pub fn new_class(&self, class_id: ClassId, class_def: &ClassDef) -> bool[src]

Register a new Javascript class.

pub fn is_registered_class(&self, class_id: ClassId) -> bool[src]

Checks if a class ID has been registered.

impl RuntimeRef[src]

impl RuntimeRef[src]

pub fn set_module_loader<T>(
    &self,
    module_normalize: ModuleNormalizeFunc,
    module_loader: ModuleLoaderFunc,
    opaque: Option<NonNull<T>>
)
[src]

Set the module loader and normalizer functions.

impl RuntimeRef[src]

pub fn set_memory_limit(&self, limit: Option<usize>) -> &Self[src]

Set a global memory allocation limit to a given Runtime.

pub fn set_gc_threshold(&self, gc_threshold: usize) -> &Self[src]

Set the GC threshold to a given Runtime.

pub fn run_gc(&self)[src]

Force to run GC to a given Runtime.

pub fn is_live_object(&self, obj: &Value) -> bool[src]

pub fn is_gc_swap(&self) -> bool[src]

pub fn memory_usage(&self) -> MemoryUsage[src]

Compute memory used by various object types.

pub fn set_interrupt_handler(&self, handler: InterruptHandler)[src]

Set a callback which is regularly called by the engine when it is executing code.

This callback can be used to implement an execution timeout.

impl RuntimeRef[src]

impl RuntimeRef[src]

pub fn free_value(&self, v: Value)[src]

Trait Implementations

impl Send for RuntimeRef

impl AsMut<RuntimeRef> for Runtime

impl PartialEq<RuntimeRef> for Runtime[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl PartialEq<RuntimeRef> for RuntimeRef[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl PartialEq<Runtime> for RuntimeRef[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl AsRef<RuntimeRef> for Runtime

impl Debug for RuntimeRef[src]

impl Borrow<RuntimeRef> for Runtime

impl BorrowMut<RuntimeRef> for Runtime

impl ForeignTypeRef for RuntimeRef

type CType = JSRuntime

The raw C type.

unsafe fn from_ptr<'a>(ptr: *mut Self::CType) -> &'a Self[src]

Constructs a shared instance of this type from its raw type.

unsafe fn from_ptr_mut<'a>(ptr: *mut Self::CType) -> &'a mut Self[src]

Constructs a mutable reference of this type from its raw type.

fn as_ptr(&self) -> *mut Self::CType[src]

Returns a raw pointer to the wrapped value.

Auto Trait Implementations

Blanket Implementations

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.

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

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

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