pub struct ObjectGraph {
pub objects: HashMap<Uuid, ObjectInstance>,
/* private fields */
}Expand description
Graph of objects with relationships indexed for fast lookup.
Fields§
§objects: HashMap<Uuid, ObjectInstance>All objects by ID
Implementations§
Source§impl ObjectGraph
impl ObjectGraph
Sourcepub fn add_object(&mut self, object: ObjectInstance)
pub fn add_object(&mut self, object: ObjectInstance)
Add an object to the graph.
Sourcepub fn get(&self, object_id: Uuid) -> Option<&ObjectInstance>
pub fn get(&self, object_id: Uuid) -> Option<&ObjectInstance>
Get an object by ID.
Sourcepub fn get_mut(&mut self, object_id: Uuid) -> Option<&mut ObjectInstance>
pub fn get_mut(&mut self, object_id: Uuid) -> Option<&mut ObjectInstance>
Get a mutable reference to an object.
Sourcepub fn get_by_external_id(&self, external_id: &str) -> Option<&ObjectInstance>
pub fn get_by_external_id(&self, external_id: &str) -> Option<&ObjectInstance>
Get an object by external ID.
Sourcepub fn get_by_type(&self, type_id: &str) -> Vec<&ObjectInstance>
pub fn get_by_type(&self, type_id: &str) -> Vec<&ObjectInstance>
Get all objects of a specific type.
Sourcepub fn iter(&self) -> impl Iterator<Item = &ObjectInstance>
pub fn iter(&self) -> impl Iterator<Item = &ObjectInstance>
Iterate over all objects.
Trait Implementations§
Source§impl Clone for ObjectGraph
impl Clone for ObjectGraph
Source§fn clone(&self) -> ObjectGraph
fn clone(&self) -> ObjectGraph
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 ObjectGraph
impl Debug for ObjectGraph
Source§impl Default for ObjectGraph
impl Default for ObjectGraph
Source§fn default() -> ObjectGraph
fn default() -> ObjectGraph
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ObjectGraph
impl<'de> Deserialize<'de> for ObjectGraph
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ObjectGraph
impl RefUnwindSafe for ObjectGraph
impl Send for ObjectGraph
impl Sync for ObjectGraph
impl Unpin for ObjectGraph
impl UnwindSafe for ObjectGraph
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