Struct AdjacencyTable

Source
pub struct AdjacencyTable<N, V>
where N: Node, V: Weight,
{ /* private fields */ }

Implementations§

Source§

impl<N, V> AdjacencyTable<N, V>
where N: Node, V: Weight,

Source

pub fn new() -> Self

Source

pub fn capacity(&self) -> usize

Source

pub fn clear(&mut self)

Source

pub fn contains_key(&self, key: &N) -> bool

Source

pub fn drain(&mut self) -> Drain<'_, N, Vec<(N, V)>>

Source

pub fn entry(&mut self, key: N) -> Entry<'_, N, Vec<(N, V)>>

Source

pub fn insert(&mut self, key: N, val: Vec<(N, V)>) -> Option<Vec<(N, V)>>

Source

pub fn get(&self, key: &N) -> Option<&Vec<(N, V)>>

Source

pub fn get_key_value(&self, key: &N) -> Option<(&N, &Vec<(N, V)>)>

Source

pub fn get_mut(&mut self, key: &N) -> Option<&mut Vec<(N, V)>>

Source

pub fn keys(&self) -> Keys<'_, N, Vec<(N, V)>>

Source

pub fn len(&self) -> usize

Source

pub fn table(self) -> HashMap<N, Vec<(N, V)>>

Source

pub fn values(&self) -> Values<'_, N, Vec<(N, V)>>

Source

pub fn values_mut(&mut self) -> ValuesMut<'_, N, Vec<(N, V)>>

Source

pub fn with_capacity(capacity: usize) -> Self

Trait Implementations§

Source§

impl<N, V> AsMut<AdjacencyTable<N, V>> for DirectedGraph<N, V>
where N: Node, V: Weight,

Source§

fn as_mut(&mut self) -> &mut AdjacencyTable<N, V>

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<N, V> AsMut<AdjacencyTable<N, V>> for UndirectedGraph<N, V>
where N: Node, V: Weight,

Source§

fn as_mut(&mut self) -> &mut AdjacencyTable<N, V>

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<N, V> AsRef<AdjacencyTable<N, V>> for DirectedGraph<N, V>
where N: Node, V: Weight,

Source§

fn as_ref(&self) -> &AdjacencyTable<N, V>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<N, V> AsRef<AdjacencyTable<N, V>> for UndirectedGraph<N, V>
where N: Node, V: Weight,

Source§

fn as_ref(&self) -> &AdjacencyTable<N, V>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<N, V> Clone for AdjacencyTable<N, V>
where N: Node + Clone, V: Weight + Clone,

Source§

fn clone(&self) -> AdjacencyTable<N, V>

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<N, V> Debug for AdjacencyTable<N, V>
where N: Node + Debug, V: Weight + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<N, V> Default for AdjacencyTable<N, V>
where N: Node + Default, V: Weight + Default,

Source§

fn default() -> AdjacencyTable<N, V>

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

impl<'de, N, V> Deserialize<'de> for AdjacencyTable<N, V>
where N: Node + Deserialize<'de>, V: Weight + Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<N, V> Extend<(N, Vec<(N, V)>)> for AdjacencyTable<N, V>
where N: Node, V: Weight,

Source§

fn extend<T: IntoIterator<Item = (N, Vec<(N, V)>)>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<N, V> From<AdjacencyTable<N, V>> for DirectedGraph<N, V>
where N: Node, V: Weight,

Source§

fn from(store: AdjacencyTable<N, V>) -> Self

Converts to this type from the input type.
Source§

impl<N, V> From<AdjacencyTable<N, V>> for UndirectedGraph<N, V>
where N: Node, V: Weight,

Source§

fn from(store: AdjacencyTable<N, V>) -> Self

Converts to this type from the input type.
Source§

impl<N, V> From<HashMap<N, Vec<(N, V)>>> for AdjacencyTable<N, V>
where N: Node, V: Weight,

Source§

fn from(store: HashMap<N, Vec<(N, V)>>) -> Self

Converts to this type from the input type.
Source§

impl<N, V> FromIterator<(N, Vec<(N, V)>)> for AdjacencyTable<N, V>
where N: Node, V: Weight,

Source§

fn from_iter<T: IntoIterator<Item = (N, Vec<(N, V)>)>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<N, V> Index<N> for AdjacencyTable<N, V>
where N: Node, V: Weight,

Source§

type Output = Vec<(N, V)>

The returned type after indexing.
Source§

fn index(&self, index: N) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<N, V> IndexMut<N> for AdjacencyTable<N, V>
where N: Node, V: Weight,

Source§

fn index_mut(&mut self, index: N) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<N, V> IntoIterator for AdjacencyTable<N, V>
where N: Node, V: Weight,

Source§

type Item = (N, Vec<(N, V)>)

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<N, Vec<(N, V)>>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<N, V> PartialEq for AdjacencyTable<N, V>
where N: Node + PartialEq, V: Weight + PartialEq,

Source§

fn eq(&self, other: &AdjacencyTable<N, V>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

const fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<N, V> Serialize for AdjacencyTable<N, V>
where N: Node + Serialize, V: Weight + Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<N, V> Eq for AdjacencyTable<N, V>
where N: Node + Eq, V: Weight + Eq,

Source§

impl<N, V> StructuralPartialEq for AdjacencyTable<N, V>
where N: Node, V: Weight,

Auto Trait Implementations§

§

impl<N, V> Freeze for AdjacencyTable<N, V>

§

impl<N, V> RefUnwindSafe for AdjacencyTable<N, V>

§

impl<N, V> Send for AdjacencyTable<N, V>
where N: Send, V: Send,

§

impl<N, V> Sync for AdjacencyTable<N, V>
where N: Sync, V: Sync,

§

impl<N, V> Unpin for AdjacencyTable<N, V>
where N: Unpin, V: Unpin,

§

impl<N, V> UnwindSafe for AdjacencyTable<N, V>
where N: UnwindSafe, V: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> Weight for T
where T: Clone + PartialEq,