#[repr(i32)]pub enum CFunctionEnum {
Show 14 variants
Generic = 0,
GenericMagic = 1,
Constructor = 2,
ConstructorMagic = 3,
ConstructorOrFunc = 4,
ConstructorOrFuncMagic = 5,
ConstructorOrFuncFlags = 6,
FF = 7,
FFF = 8,
Getter = 9,
Setter = 10,
GetterMagic = 11,
SetterMagic = 12,
IteratorNext = 13,
}Expand description
JSCFunctionEnum: which calling convention a JSCFunctionType holds.
Only the ones a JSCFunctionListEntry can name are listed; the reference’s remaining
values (f_f, f_f_f, iterator_next, …) are JS_CFUNC_SPECIAL_DEF’s business and
arrive with the built-in classes that want them.
Variants§
Generic = 0
JS_CFUNC_generic: (ctx, this_val, argc, argv).
GenericMagic = 1
JS_CFUNC_generic_magic: the same plus a trailing magic.
Constructor = 2
JS_CFUNC_constructor: (ctx, new_target, argc, argv), and new is allowed.
ConstructorMagic = 3
JS_CFUNC_constructor_magic.
ConstructorOrFunc = 4
JS_CFUNC_constructor_or_func: (ctx, this_val, argc, argv) either way.
ConstructorOrFuncMagic = 5
JS_CFUNC_constructor_or_func_magic.
ConstructorOrFuncFlags = 6
JS_CFUNC_constructor_or_func_flags: (ctx, func_obj, this_val, argc, argv, flags).
FF = 7
JS_CFUNC_f_f.
FFF = 8
JS_CFUNC_f_f_f.
Getter = 9
JS_CFUNC_getter: (ctx, this_val).
Setter = 10
JS_CFUNC_setter: (ctx, this_val, val).
GetterMagic = 11
JS_CFUNC_getter_magic.
SetterMagic = 12
JS_CFUNC_setter_magic.
IteratorNext = 13
JS_CFUNC_iterator_next.
Implementations§
Source§impl CFunctionEnum
impl CFunctionEnum
Sourcepub fn from_raw(raw: u8) -> Option<CFunctionEnum>
pub fn from_raw(raw: u8) -> Option<CFunctionEnum>
The enum value as C would have written it, or None for a value this layer does not
implement — which is a TypeError for the caller rather than a guess at a calling
convention.
Sourcepub fn is_constructor(self) -> bool
pub fn is_constructor(self) -> bool
Whether new is allowed on a function with this convention.