Trait mozjs_sys::jsgc::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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Initialize for *mut BigInt

source§

impl Initialize for *mut Symbol

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<T> Initialize for Option<T>

source§

unsafe fn initial() -> Option<Self>

Implementors§