Skip to main content

CFunctionEnum

Enum CFunctionEnum 

Source
#[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

Source

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.

Source

pub fn is_constructor(self) -> bool

Whether new is allowed on a function with this convention.

Trait Implementations§

Source§

impl Clone for CFunctionEnum

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for CFunctionEnum

Source§

impl Debug for CFunctionEnum

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for CFunctionEnum

Source§

impl PartialEq for CFunctionEnum

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CFunctionEnum

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.