pub struct NetworkData { /* private fields */ }Implementations§
Source§impl NetworkData
impl NetworkData
pub fn new() -> Self
Sourcepub fn add_edge<E: Entity, ET: EdgeType<E>>(
&mut self,
entity_id: EntityId<E>,
neighbor: EntityId<E>,
weight: f32,
inner: ET,
) -> Result<(), IxaError>
pub fn add_edge<E: Entity, ET: EdgeType<E>>( &mut self, entity_id: EntityId<E>, neighbor: EntityId<E>, weight: f32, inner: ET, ) -> Result<(), IxaError>
Inserts the given edge into the adjacency list for the given entity. If an edge having the same neighbor as the given edge exists, an error is returned.
Sourcepub fn remove_edge<E: Entity, ET: EdgeType<E>>(
&mut self,
entity_id: EntityId<E>,
neighbor: EntityId<E>,
) -> Option<Edge<E, ET>>
pub fn remove_edge<E: Entity, ET: EdgeType<E>>( &mut self, entity_id: EntityId<E>, neighbor: EntityId<E>, ) -> Option<Edge<E, ET>>
Remove the edge from the given entity to the given neighbor and return it, or
None if the edge does not exist.
Sourcepub fn get_edge<E: Entity, ET: EdgeType<E>>(
&self,
entity_id: EntityId<E>,
neighbor: EntityId<E>,
) -> Option<&Edge<E, ET>>
pub fn get_edge<E: Entity, ET: EdgeType<E>>( &self, entity_id: EntityId<E>, neighbor: EntityId<E>, ) -> Option<&Edge<E, ET>>
Returns an immutable reference to the edge from the given entity
to the given neighbor, or None if the edge does not exist.
Sourcepub fn get_edges<E: Entity, ET: EdgeType<E>>(
&self,
entity_id: EntityId<E>,
) -> Vec<Edge<E, ET>>
pub fn get_edges<E: Entity, ET: EdgeType<E>>( &self, entity_id: EntityId<E>, ) -> Vec<Edge<E, ET>>
Returns a clone of the adjacency list for the given entity. Returns an empty list if the list is empty.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NetworkData
impl !RefUnwindSafe for NetworkData
impl !Send for NetworkData
impl !Sync for NetworkData
impl Unpin for NetworkData
impl !UnwindSafe for NetworkData
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