pub struct Node {
pub id: NodeId,
pub labels: Vec<Arc<str>>,
pub properties: BTreeMap<PropertyKey, Value>,
}Expand description
A node in the labeled property graph.
This is the high-level representation of a node with all its data.
Fields§
§id: NodeIdUnique identifier.
labels: Vec<Arc<str>>Labels attached to this node.
properties: BTreeMap<PropertyKey, Value>Properties stored on this node.
Implementations§
Source§impl Node
impl Node
Sourcepub fn with_labels(
id: NodeId,
labels: impl IntoIterator<Item = impl Into<Arc<str>>>,
) -> Self
pub fn with_labels( id: NodeId, labels: impl IntoIterator<Item = impl Into<Arc<str>>>, ) -> Self
Creates a new node with labels.
Sourcepub fn remove_label(&mut self, label: &str) -> bool
pub fn remove_label(&mut self, label: &str) -> bool
Removes a label from this node.
Sourcepub fn set_property(
&mut self,
key: impl Into<PropertyKey>,
value: impl Into<Value>,
)
pub fn set_property( &mut self, key: impl Into<PropertyKey>, value: impl Into<Value>, )
Sets a property on this node.
Sourcepub fn get_property(&self, key: &str) -> Option<&Value>
pub fn get_property(&self, key: &str) -> Option<&Value>
Gets a property from this node.
Sourcepub fn remove_property(&mut self, key: &str) -> Option<Value>
pub fn remove_property(&mut self, key: &str) -> Option<Value>
Removes a property from this node.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnwindSafe for Node
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