pub struct RantyMap { /* private fields */ }Expand description
Represents Ranty’s map type, which stores a mutable collection of key-value pairs.
Map keys are always strings.
Implementations§
Source§impl RantyMap
impl RantyMap
pub fn new() -> Self
pub fn into_handle(self) -> RantyMapHandle
pub fn clear(&mut self)
pub fn raw_len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn proto(&self) -> Option<RantyMapHandle>
pub fn extend<M: Deref<Target = RantyMap>>(&mut self, other: M)
pub fn set_proto(&mut self, proto: Option<RantyMapHandle>)
pub fn raw_set(&mut self, key: &str, val: RantyValue)
pub fn raw_remove(&mut self, key: &str)
pub fn raw_take(&mut self, key: &str) -> Option<RantyValue>
pub fn raw_get(&self, key: &str) -> Option<&RantyValue>
pub fn get(&self, key: &str) -> Option<Cow<'_, RantyValue>>
pub fn raw_has_key(&self, key: &str) -> bool
pub fn raw_keys(&self) -> RantyList
pub fn raw_values(&self) -> RantyList
Trait Implementations§
Source§impl From<RantyMap> for RantyMapHandle
impl From<RantyMap> for RantyMapHandle
Source§impl IntoRanty for RantyMap
impl IntoRanty for RantyMap
Source§fn into_ranty(self) -> RantyValue
fn into_ranty(self) -> RantyValue
Converts to a
RantyValue.Source§impl TryIntoRanty for RantyMap
impl TryIntoRanty for RantyMap
Source§fn try_into_ranty(self) -> Result<RantyValue, ValueError>
fn try_into_ranty(self) -> Result<RantyValue, ValueError>
Attempts to convert to a
RantyValue.Auto Trait Implementations§
impl Freeze for RantyMap
impl !RefUnwindSafe for RantyMap
impl !Send for RantyMap
impl !Sync for RantyMap
impl Unpin for RantyMap
impl UnsafeUnpin for RantyMap
impl UnwindSafe for RantyMap
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