pub struct SimpleNode { /* private fields */ }Expand description
A graph node (Java SimpleNode): unique alias, one or more types, and a
property bag. Shared by Arc; equality is by node id.
Implementations§
Source§impl SimpleNode
impl SimpleNode
pub fn get_id(&self) -> &str
pub fn get_alias(&self) -> &str
pub fn get_types(&self) -> HashSet<String>
pub fn add_type(&self, node_type: &str) -> Result<(), AppError>
Sourcepub fn reset_types(&self, initial: &str) -> Result<(), AppError>
pub fn reset_types(&self, initial: &str) -> Result<(), AppError>
Replace all types with one initial type (the Java Playground’s
update node mutates the live type set; this is the explicit analog).
Sourcepub fn clear_properties(&self)
pub fn clear_properties(&self)
Remove all properties (the Java Playground’s update node analog).
Sourcepub fn remove_type(&self, node_type: &str) -> Result<(), AppError>
pub fn remove_type(&self, node_type: &str) -> Result<(), AppError>
A node keeps at least one type (Java parity).
pub fn get_properties(&self) -> HashMap<String, Value>
pub fn get_property(&self, key: &str) -> Option<Value>
pub fn add_property(&self, key: &str, value: Value) -> Result<(), AppError>
pub fn remove_property(&self, key: &str) -> Result<(), AppError>
Trait Implementations§
Source§impl Debug for SimpleNode
impl Debug for SimpleNode
impl Eq for SimpleNode
Auto Trait Implementations§
impl !Freeze for SimpleNode
impl RefUnwindSafe for SimpleNode
impl Send for SimpleNode
impl Sync for SimpleNode
impl Unpin for SimpleNode
impl UnsafeUnpin for SimpleNode
impl UnwindSafe for SimpleNode
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.