pub struct FieldDef {
pub name: &'static str,
pub detail: FieldDetail,
pub prop_flags: u8,
pub magic: i16,
}Fields§
§name: &'static str§detail: FieldDetail§prop_flags: u8§magic: i16Implementations§
Source§impl FieldDef
impl FieldDef
Sourcepub const fn CALL(
name: &'static str,
length: u8,
callback: fn(cc: CallContext<'_>) -> JSResult,
magic: i16,
) -> Self
pub const fn CALL( name: &'static str, length: u8, callback: fn(cc: CallContext<'_>) -> JSResult, magic: i16, ) -> Self
Define a callback function backed by a native handler.
Sourcepub const fn GETSET(
name: &'static str,
get: Option<fn(cc: CallContext<'_>) -> JSResult>,
set: Option<fn(cc: CallContext<'_>) -> JSResult>,
magic: i16,
) -> Self
pub const fn GETSET( name: &'static str, get: Option<fn(cc: CallContext<'_>) -> JSResult>, set: Option<fn(cc: CallContext<'_>) -> JSResult>, magic: i16, ) -> Self
Define a getter, setter field
Sourcepub const fn ITERATOR_NEXT(
name: &'static str,
length: u8,
callback: fn(cc: CallContext<'_>, iter_state: &mut IteratorState) -> JSResult,
magic: i16,
) -> Self
pub const fn ITERATOR_NEXT( name: &'static str, length: u8, callback: fn(cc: CallContext<'_>, iter_state: &mut IteratorState) -> JSResult, magic: i16, ) -> Self
Define an iterator next function field backed by a native callback handler.
Sourcepub const fn OBJECT(
name: &'static str,
entries: &'static [Self],
prop_flags: u32,
) -> Self
pub const fn OBJECT( name: &'static str, entries: &'static [Self], prop_flags: u32, ) -> Self
Define a lazy init object with entries.
Sourcepub const fn FLOAT64(name: &'static str, val: f64, prop_flags: u32) -> Self
pub const fn FLOAT64(name: &'static str, val: f64, prop_flags: u32) -> Self
Define an f64 field
Sourcepub const fn STR(name: &'static str, val: &'static str, prop_flags: u32) -> Self
pub const fn STR(name: &'static str, val: &'static str, prop_flags: u32) -> Self
Define a str field
Sourcepub const fn UNDEFINED(name: &'static str, prop_flags: u32) -> Self
pub const fn UNDEFINED(name: &'static str, prop_flags: u32) -> Self
Define an undefined value field
pub const fn BUILD( name: &'static str, f: fn(Context<'_>) -> Result<JSValue, i32>, prop_flags: u32, ) -> Self
Sourcepub const fn ALIAS_BASE(
name: &'static str,
from_name: &'static str,
base: i32,
) -> Self
pub const fn ALIAS_BASE( name: &'static str, from_name: &'static str, base: i32, ) -> Self
Define an alias field
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FieldDef
impl RefUnwindSafe for FieldDef
impl Send for FieldDef
impl Sync for FieldDef
impl Unpin for FieldDef
impl UnwindSafe for FieldDef
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