HashMapProp

Struct HashMapProp 

Source
pub struct HashMapProp<I: GraphItem, T: Clone, S = RandomState> { /* private fields */ }
Expand description

A property backed by a HashMap.

Implementations§

Source§

impl<I, T> HashMapProp<I, T>
where I: GraphItem, T: Clone,

Source

pub fn new(default: T) -> Self

Creates a new HashMapProp that maps each to key to a reference to default value until a value is associated with the key.

As there can be many references to default, interior mutability should be used with caution.

Source§

impl<I, T, S> HashMapProp<I, T, S>
where I: GraphItem, T: Clone, S: BuildHasher,

Source

pub fn with_hasher(default: T, hasher: S) -> Self

Trait Implementations§

Source§

impl<G, T, S> EdgePropMutNew<G, T> for HashMapProp<Edge<G>, T, S>
where G: WithEdge, T: Clone, S: BuildHasher + Default,

Source§

fn new_edge_prop(_: &G, value: T) -> Self
where T: Clone,

Creates a new edge prop. Read more
Source§

impl<I, T, S> Index<I> for HashMapProp<I, T, S>
where I: GraphItem, T: Clone, S: BuildHasher,

Source§

type Output = T

The returned type after indexing.
Source§

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

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

impl<I, T, S> IndexMut<I> for HashMapProp<I, T, S>
where I: GraphItem, T: Clone, S: BuildHasher,

Source§

fn index_mut(&mut self, v: I) -> &mut Self::Output

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

impl<G, T, S> VertexPropMutNew<G, T> for HashMapProp<Vertex<G>, T, S>
where G: WithVertex, T: Clone, S: BuildHasher + Default,

Source§

fn new_vertex_prop(_: &G, value: T) -> Self
where T: Clone,

Creates a new vertex prop. Read more

Auto Trait Implementations§

§

impl<I, T, S> Freeze for HashMapProp<I, T, S>
where T: Freeze, S: Freeze,

§

impl<I, T, S> RefUnwindSafe for HashMapProp<I, T, S>

§

impl<I, T, S> Send for HashMapProp<I, T, S>
where T: Send, S: Send, I: Send,

§

impl<I, T, S> Sync for HashMapProp<I, T, S>
where T: Sync, S: Sync, I: Sync,

§

impl<I, T, S> Unpin for HashMapProp<I, T, S>
where T: Unpin, S: Unpin, I: Unpin,

§

impl<I, T, S> UnwindSafe for HashMapProp<I, T, S>
where T: UnwindSafe, I: UnwindSafe, S: 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> 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> IntoOwned<T> for T

Source§

fn into_owned(self) -> T

Source§

impl<P, Idx> PropIndexMut<Idx> for P
where P: IndexMut<Idx>,

Source§

fn set_values_from<P, I>(&mut self, iter: I, source: &P)
where I: IntoIterator, I::Item: IntoOwned<Idx>, Idx: Clone, P: Index<Idx, Output = Self::Output>, Self::Output: Clone,

Set the value associated with each key produced by iter to the value associated with the key in the property source.
Source§

fn set_values<I>(&mut self, iter: I, value: Self::Output)
where I: IntoIterator, I::Item: IntoOwned<Idx>, Self::Output: Clone,

Set the value associated with keys produced by iter to value.
Source§

impl<G> Sets for G

Source§

fn vertices_complement<I>(&self, vertices: I) -> VerticesComplement<'_, Self>

Source§

fn edges_complement<I>(&self, edges: I) -> EdgesComplement<'_, Self>
where Self: EdgeList + WithEdgeProp<bool>, I: IntoIterator, I::Item: IntoOwned<Edge<Self>>,

Source§

fn independent_vertex_set_from_iter<I>( &self, vertices: I, ) -> IndependentVertexSetFromIter<'_, Self, I::IntoIter>

Source§

fn is_independent_vertex_set<I>(&self, vertices: I) -> bool

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<P, G, T> EdgeProp<G, T> for P
where G: WithEdge, P: Index<<G as WithEdge>::Edge, Output = T>,

Source§

impl<P, G, T> EdgePropMut<G, T> for P
where G: WithEdge, P: IndexMut<<G as WithEdge>::Edge, Output = T>,

Source§

impl<P, G, T> VertexProp<G, T> for P
where G: WithVertex, P: Index<<G as WithVertex>::Vertex, Output = T>,

Source§

impl<P, G, T> VertexPropMut<G, T> for P
where G: WithVertex, P: IndexMut<<G as WithVertex>::Vertex, Output = T>,