pub struct IgnoreWriteProp<T> { /* private fields */ }Expand description
A property that ignore writes.
This struct maintains two values, one that is returned when a shared reference is requested
and one that is returned when a mutable reference is requested. Before returning the mutable
reference, the value is cloned from the original value, so it seems that all previous writes
was ignored.
§Example
use fera_graph::prelude::*;
use fera_graph::props::IgnoreWriteProp;
let g = CompleteGraph::new(5);
let mut p: IgnoreWriteProp<u32> = g.vertex_prop(3);
assert_eq!(3, p[0]);
p[0] = 20;
// the previous write was "ignored"
assert_eq!(3, p[0]);Trait Implementations§
Source§impl<G, T> EdgePropMutNew<G, T> for IgnoreWriteProp<T>
impl<G, T> EdgePropMutNew<G, T> for IgnoreWriteProp<T>
Source§fn new_edge_prop(_: &G, value: T) -> Self
fn new_edge_prop(_: &G, value: T) -> Self
Creates a new edge prop. Read more
Source§impl<I, T: Clone> Index<I> for IgnoreWriteProp<T>
impl<I, T: Clone> Index<I> for IgnoreWriteProp<T>
Source§impl<I, T: Clone> IndexMut<I> for IgnoreWriteProp<T>
impl<I, T: Clone> IndexMut<I> for IgnoreWriteProp<T>
Source§impl<G, T> VertexPropMutNew<G, T> for IgnoreWriteProp<T>where
G: WithVertex,
T: Clone,
impl<G, T> VertexPropMutNew<G, T> for IgnoreWriteProp<T>where
G: WithVertex,
T: Clone,
Source§fn new_vertex_prop(_: &G, value: T) -> Self
fn new_vertex_prop(_: &G, value: T) -> Self
Creates a new vertex prop. Read more
Auto Trait Implementations§
impl<T> Freeze for IgnoreWriteProp<T>where
T: Freeze,
impl<T> RefUnwindSafe for IgnoreWriteProp<T>where
T: RefUnwindSafe,
impl<T> Send for IgnoreWriteProp<T>where
T: Send,
impl<T> Sync for IgnoreWriteProp<T>where
T: Sync,
impl<T> Unpin for IgnoreWriteProp<T>where
T: Unpin,
impl<T> UnwindSafe for IgnoreWriteProp<T>where
T: UnwindSafe,
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
Source§impl<P, Idx> PropIndexMut<Idx> for Pwhere
P: IndexMut<Idx>,
impl<P, Idx> PropIndexMut<Idx> for Pwhere
P: IndexMut<Idx>,
Source§fn set_values_from<P, I>(&mut self, iter: I, source: &P)
fn set_values_from<P, I>(&mut self, iter: I, source: &P)
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)
fn set_values<I>(&mut self, iter: I, value: Self::Output)
Set the value associated with keys produced by
iter to value.