pub struct JSObjectData {
pub properties: HashMap<PropertyKey, Rc<RefCell<Value>>>,
pub constants: HashSet<String>,
pub non_enumerable: HashSet<PropertyKey>,
pub non_writable: HashSet<PropertyKey>,
pub non_configurable: HashSet<PropertyKey>,
pub prototype: Option<Rc<RefCell<JSObjectData>>>,
pub is_function_scope: bool,
}Fields§
§properties: HashMap<PropertyKey, Rc<RefCell<Value>>>§constants: HashSet<String>§non_enumerable: HashSet<PropertyKey>Tracks keys that should not be enumerated by Object.keys / Object.values.
non_writable: HashSet<PropertyKey>Tracks keys that are non-writable (read-only)
non_configurable: HashSet<PropertyKey>Tracks keys that are non-configurable
prototype: Option<Rc<RefCell<JSObjectData>>>§is_function_scope: boolImplementations§
Source§impl JSObjectData
impl JSObjectData
pub fn new() -> Self
pub fn insert(&mut self, key: PropertyKey, val: Rc<RefCell<Value>>)
Sourcepub fn set_non_enumerable(&mut self, key: PropertyKey)
pub fn set_non_enumerable(&mut self, key: PropertyKey)
Mark a property key as non-enumerable on this object
Sourcepub fn set_non_writable(&mut self, key: PropertyKey)
pub fn set_non_writable(&mut self, key: PropertyKey)
Mark a property key as non-writable on this object
Sourcepub fn set_non_configurable(&mut self, key: PropertyKey)
pub fn set_non_configurable(&mut self, key: PropertyKey)
Mark a property key as non-configurable on this object
Sourcepub fn is_writable(&self, key: &PropertyKey) -> bool
pub fn is_writable(&self, key: &PropertyKey) -> bool
Check whether a key is writable (default true)
Sourcepub fn is_configurable(&self, key: &PropertyKey) -> bool
pub fn is_configurable(&self, key: &PropertyKey) -> bool
Check whether a key is configurable (default true)
Sourcepub fn is_enumerable(&self, key: &PropertyKey) -> bool
pub fn is_enumerable(&self, key: &PropertyKey) -> bool
Check whether a key is enumerable (default true)
pub fn get(&self, key: &PropertyKey) -> Option<Rc<RefCell<Value>>>
pub fn contains_key(&self, key: &PropertyKey) -> bool
pub fn remove(&mut self, key: &PropertyKey) -> Option<Rc<RefCell<Value>>>
pub fn keys(&self) -> Keys<'_, PropertyKey, Rc<RefCell<Value>>>
pub fn is_const(&self, key: &str) -> bool
pub fn set_const(&mut self, key: String)
Trait Implementations§
Source§impl Clone for JSObjectData
impl Clone for JSObjectData
Source§fn clone(&self) -> JSObjectData
fn clone(&self) -> JSObjectData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for JSObjectData
impl Debug for JSObjectData
Source§impl Default for JSObjectData
impl Default for JSObjectData
Source§fn default() -> JSObjectData
fn default() -> JSObjectData
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for JSObjectData
impl !RefUnwindSafe for JSObjectData
impl !Send for JSObjectData
impl !Sync for JSObjectData
impl Unpin for JSObjectData
impl !UnwindSafe for JSObjectData
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