Struct fera_graph::props::IgnoreWriteProp [] [src]

pub struct IgnoreWriteProp<T> { /* fields omitted */ }

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

impl<I, T: Clone> Index<I> for IgnoreWriteProp<T>
[src]

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

impl<I, T: Clone> IndexMut<I> for IgnoreWriteProp<T>
[src]

[src]

Performs the mutable indexing (container[index]) operation.

impl<G, T> VertexPropMutNew<G, T> for IgnoreWriteProp<T> where
    G: WithVertex,
    T: Clone
[src]

[src]

Creates a new vertex prop. Read more

impl<G, T> EdgePropMutNew<G, T> for IgnoreWriteProp<T> where
    G: WithEdge,
    T: Clone
[src]

[src]

Creates a new edge prop. Read more