pub struct Attributes { /* private fields */ }
Expand description
A set of attributes associated with a graph node or edge
Implementations§
Source§impl Attributes
impl Attributes
Sourcepub fn new() -> Attributes
pub fn new() -> Attributes
Creates a new, empty set of attributes.
Sourcepub fn add<V: Into<Value>>(
&mut self,
name: Identifier,
value: V,
) -> Result<(), Value>
pub fn add<V: Into<Value>>( &mut self, name: Identifier, value: V, ) -> Result<(), Value>
Adds an attribute to this attribute set. If there was already an attribute with the same
name, replaces its value and returns Err
.
Sourcepub fn get<Q>(&self, name: &Q) -> Option<&Value>
pub fn get<Q>(&self, name: &Q) -> Option<&Value>
Returns the value of a particular attribute, if it exists.
pub fn iter(&self) -> impl Iterator<Item = (&Identifier, &Value)>
Trait Implementations§
Source§impl Clone for Attributes
impl Clone for Attributes
Source§fn clone(&self) -> Attributes
fn clone(&self) -> Attributes
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Attributes
impl Debug for Attributes
Source§impl Display for Attributes
impl Display for Attributes
Auto Trait Implementations§
impl Freeze for Attributes
impl RefUnwindSafe for Attributes
impl Send for Attributes
impl Sync for Attributes
impl Unpin for Attributes
impl UnwindSafe for Attributes
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