Struct fera_graph::props::HashMapProp
source · pub struct HashMapProp<I: GraphItem, T: Clone, S = RandomState> { /* private fields */ }
Expand description
A property backed by a HashMap
.
Implementations
sourceimpl<I, T> HashMapProp<I, T>where
I: GraphItem,
T: Clone,
impl<I, T> HashMapProp<I, T>where
I: GraphItem,
T: Clone,
sourcepub fn new(default: T) -> Self
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.
sourceimpl<I, T, S> HashMapProp<I, T, S>where
I: GraphItem,
T: Clone,
S: BuildHasher,
impl<I, T, S> HashMapProp<I, T, S>where
I: GraphItem,
T: Clone,
S: BuildHasher,
pub fn with_hasher(default: T, hasher: S) -> Self
Trait Implementations
sourceimpl<G, T, S> EdgePropMutNew<G, T> for HashMapProp<Edge<G>, T, S>where
G: WithEdge,
T: Clone,
S: BuildHasher + Default,
impl<G, T, S> EdgePropMutNew<G, T> for HashMapProp<Edge<G>, T, S>where
G: WithEdge,
T: Clone,
S: BuildHasher + Default,
sourcefn new_edge_prop(_: &G, value: T) -> Selfwhere
T: Clone,
fn new_edge_prop(_: &G, value: T) -> Selfwhere
T: Clone,
Creates a new edge prop. Read more
sourceimpl<I, T, S> Index<I> for HashMapProp<I, T, S>where
I: GraphItem,
T: Clone,
S: BuildHasher,
impl<I, T, S> Index<I> for HashMapProp<I, T, S>where
I: GraphItem,
T: Clone,
S: BuildHasher,
sourceimpl<I, T, S> IndexMut<I> for HashMapProp<I, T, S>where
I: GraphItem,
T: Clone,
S: BuildHasher,
impl<I, T, S> IndexMut<I> for HashMapProp<I, T, S>where
I: GraphItem,
T: Clone,
S: BuildHasher,
sourceimpl<G, T, S> VertexPropMutNew<G, T> for HashMapProp<Vertex<G>, T, S>where
G: WithVertex,
T: Clone,
S: BuildHasher + Default,
impl<G, T, S> VertexPropMutNew<G, T> for HashMapProp<Vertex<G>, T, S>where
G: WithVertex,
T: Clone,
S: BuildHasher + Default,
sourcefn new_vertex_prop(_: &G, value: T) -> Selfwhere
T: Clone,
fn new_vertex_prop(_: &G, value: T) -> Selfwhere
T: Clone,
Creates a new vertex prop. Read more
Auto Trait Implementations
impl<I, T, S> RefUnwindSafe for HashMapProp<I, T, S>where
I: RefUnwindSafe,
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<I, T, S> Send for HashMapProp<I, T, S>where
I: Send,
S: Send,
T: Send,
impl<I, T, S> Sync for HashMapProp<I, T, S>where
I: Sync,
S: Sync,
T: Sync,
impl<I, T, S> Unpin for HashMapProp<I, T, S>where
I: Unpin,
S: Unpin,
T: Unpin,
impl<I, T, S> UnwindSafe for HashMapProp<I, T, S>where
I: UnwindSafe,
S: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> IntoOwned<T> for T
impl<T> IntoOwned<T> for T
fn into_owned(self) -> T
sourceimpl<P, Idx> PropIndexMut<Idx> for Pwhere
P: IndexMut<Idx>,
impl<P, Idx> PropIndexMut<Idx> for Pwhere
P: IndexMut<Idx>,
sourcefn 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,
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
. Read moresourcefn set_values<I>(&mut self, iter: I, value: Self::Output)where
I: IntoIterator,
I::Item: IntoOwned<Idx>,
Self::Output: Clone,
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
.