NetworkData

Struct NetworkData 

Source
pub struct NetworkData { /* private fields */ }

Implementations§

Source§

impl NetworkData

Source

pub fn new() -> Self

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn get_edges_ref<E: Entity, ET: EdgeType<E>>( &self, entity_id: EntityId<E>, ) -> Option<&Vec<Edge<E, ET>>>

Returns a clone of the adjacency list for the given entity. Returns an empty list if the list is empty.

Source

pub fn find_entities_by_degree<E: Entity, ET: EdgeType<E>>( &self, degree: usize, ) -> Vec<EntityId<E>>

Returns a list of EntityId<E>s having exactly the given number of neighbors.

Trait Implementations§

Source§

impl Default for NetworkData

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V