Skip to main content

FunctionListUnion

Union FunctionListUnion 

Source
#[repr(C)]
pub union FunctionListUnion { pub func: ManuallyDrop<FunctionEntry>, pub getset: ManuallyDrop<GetSetEntry>, pub alias_name: *const c_char, pub alias_base: c_int, pub prop_list_tab: *const JSCFunctionListEntry, pub prop_list_len: c_int, pub str_: *const c_char, pub i32: i32, pub i64: i64, pub f64: f64, pub raw: u64, }
Expand description

The u union of JSCFunctionListEntry.

A union in C; a struct here, because we read exactly one arm per entry and the arms all start at offset 0 — with the exception of func, whose cfunc is at 8 rather than 0. Modelling it as a struct of overlapping fields would need unsafe reads of a union for no gain: the field we want is chosen by def_type, which is checked before anything is read.

Fields§

§func: ManuallyDrop<FunctionEntry>

u.func.

§getset: ManuallyDrop<GetSetEntry>

u.getset.

§alias_name: *const c_char

u.alias.name.

§alias_base: c_int

u.alias.base.

§prop_list_tab: *const JSCFunctionListEntry

u.prop_list.tab.

§prop_list_len: c_int

u.prop_list.len.

§str_: *const c_char

u.str.

§i32: i32

u.i32, and also u.alias.base/u.prop_list.len’s storage.

§i64: i64

u.i64.

§f64: f64

u.f64.

§raw: u64

The raw eight bytes, for the cases where the arm is a pair of 4-byte words.

Trait Implementations§

Source§

impl Clone for FunctionListUnion

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 FunctionListUnion

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.