pub struct DataMap { /* private fields */ }Expand description
Untyped data map: maps (node_id, key) → DataValue. This is the Rust-side of the JS node.data map. When a JS plugin runs after a Rust plugin, this gets synced to the JS DataMap.
Implementations§
Source§impl DataMap
impl DataMap
pub fn new() -> Self
pub fn set(&mut self, node_id: u32, key: &str, value: DataValue)
pub fn get(&self, node_id: u32, key: &str) -> Option<&DataValue>
pub fn remove(&mut self, node_id: u32, key: &str)
pub fn has(&self, node_id: u32, key: &str) -> bool
Sourcepub fn entries_for_node(
&self,
node_id: u32,
) -> impl Iterator<Item = (&str, &DataValue)>
pub fn entries_for_node( &self, node_id: u32, ) -> impl Iterator<Item = (&str, &DataValue)>
Iterate all entries for a given node_id
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DataMap
impl RefUnwindSafe for DataMap
impl Send for DataMap
impl Sync for DataMap
impl Unpin for DataMap
impl UnsafeUnpin for DataMap
impl UnwindSafe for DataMap
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