mozjs::gc

Trait Initialize

Source
pub trait Initialize: Sized {
    // Required method
    unsafe fn initial() -> Option<Self>;
}
Expand description

Trait that provides a GC-safe default value for the given type, if one exists.

Required Methods§

Source

unsafe fn initial() -> Option<Self>

Create a default value. If there is no meaningful default possible, returns None. SAFETY: The default must not be a value that can be meaningfully garbage collected.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Initialize for *mut BigInt

Source§

impl Initialize for *mut JSFunction

Source§

impl Initialize for *mut JSObject

Source§

impl Initialize for *mut JSScript

Source§

impl Initialize for *mut JSString

Source§

impl Initialize for *mut Symbol

Source§

impl<T> Initialize for Option<T>

Source§

unsafe fn initial() -> Option<Option<T>>

Implementors§