#[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_charu.alias.name.
alias_base: c_intu.alias.base.
prop_list_tab: *const JSCFunctionListEntryu.prop_list.tab.
prop_list_len: c_intu.prop_list.len.
str_: *const c_charu.str.
i32: i32u.i32, and also u.alias.base/u.prop_list.len’s storage.
i64: i64u.i64.
f64: f64u.f64.
raw: u64The raw eight bytes, for the cases where the arm is a pair of 4-byte words.
Trait Implementations§
Source§impl Clone for FunctionListUnion
impl Clone for FunctionListUnion
impl Copy for FunctionListUnion
Auto Trait Implementations§
impl !Send for FunctionListUnion
impl !Sync for FunctionListUnion
impl Forget for FunctionListUnion
impl Freeze for FunctionListUnion
impl Move for FunctionListUnion
impl RefUnwindSafe for FunctionListUnion
impl Unpin for FunctionListUnion
impl UnsafeUnpin for FunctionListUnion
impl UnwindSafe for FunctionListUnion
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more