pub struct MapObj {
pub meta: GosMetadata,
pub map: Option<Rc<RefCell<GosHashMap>>>,
/* private fields */
}
Fields§
§meta: GosMetadata
§map: Option<Rc<RefCell<GosHashMap>>>
Implementations§
Source§impl MapObj
impl MapObj
pub fn new(meta: GosMetadata, default_val: GosValue) -> MapObj
pub fn new_nil(meta: GosMetadata, default_val: GosValue) -> MapObj
Sourcepub fn deep_clone(&self, gcos: &GcoVec) -> MapObj
pub fn deep_clone(&self, gcos: &GcoVec) -> MapObj
deep_clone creates a new MapObj with duplicated content of ‘self.map’
pub fn insert(&self, key: GosValue, val: GosValue) -> Option<GosValue>
pub fn is_nil(&self) -> bool
pub fn get(&self, key: &GosValue) -> GosValue
pub fn try_get(&self, key: &GosValue) -> Option<GosValue>
Sourcepub fn touch_key(&self, key: &GosValue)
pub fn touch_key(&self, key: &GosValue)
touch_key makes sure there is a value for the ‘key’, a default value is set if the value is empty
pub fn len(&self) -> usize
pub fn borrow_data_mut(&self) -> RefMut<'_, GosHashMap>
pub fn borrow_data(&self) -> Ref<'_, GosHashMap>
pub fn clone_inner(&self) -> Rc<RefCell<GosHashMap>>
Trait Implementations§
impl Eq for MapObj
Auto Trait Implementations§
impl !Freeze for MapObj
impl !RefUnwindSafe for MapObj
impl !Send for MapObj
impl !Sync for MapObj
impl Unpin for MapObj
impl !UnwindSafe for MapObj
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