pub struct ViewMut<T, G = SomeDefault>where
G: Gen<T>,{ /* private fields */ }Expand description
A mutably borrowed resource that may be created by default.
Node functions wrap their parameters in View, ViewMut or Move.
ViewMut has two type parameters:
T- The type of the resource.G- The method by which the resource can be generated if it doesn’t already exist. By default this isSomeDefault, which denotes creating the resource using its default implementation. Another option isNoDefaultwhich fails to generate the resource.
use moongraph::*;
let mut graph = Graph::default();
let default_number = graph.visit(|u: ViewMut<usize>| { *u }).map_err(|e| e.to_string());
assert_eq!(Ok(0), default_number);
let no_number = graph.visit(|f: ViewMut<f32, NoDefault>| *f);
assert!(no_number.is_err());Trait Implementations§
Source§impl<T, G> Edges for ViewMut<T, G>
impl<T, G> Edges for ViewMut<T, G>
Source§impl<'a, T, G> IntoIterator for &'a ViewMut<T, G>
impl<'a, T, G> IntoIterator for &'a ViewMut<T, G>
Source§impl<'a, T, G> IntoIterator for &'a mut ViewMut<T, G>
impl<'a, T, G> IntoIterator for &'a mut ViewMut<T, G>
Source§impl<'a, T, G> IntoParallelIterator for &'a ViewMut<T, G>
impl<'a, T, G> IntoParallelIterator for &'a ViewMut<T, G>
Source§type Item = <&'a T as IntoParallelIterator>::Item
type Item = <&'a T as IntoParallelIterator>::Item
The type of item that the parallel iterator will produce.
Source§type Iter = <&'a T as IntoParallelIterator>::Iter
type Iter = <&'a T as IntoParallelIterator>::Iter
The parallel iterator type that will be created.
Source§fn into_par_iter(self) -> <&'a ViewMut<T, G> as IntoParallelIterator>::Iter
fn into_par_iter(self) -> <&'a ViewMut<T, G> as IntoParallelIterator>::Iter
Converts
self into a parallel iterator. Read moreSource§impl<'a, T, G> IntoParallelIterator for &'a mut ViewMut<T, G>
impl<'a, T, G> IntoParallelIterator for &'a mut ViewMut<T, G>
Source§type Item = <&'a mut T as IntoParallelIterator>::Item
type Item = <&'a mut T as IntoParallelIterator>::Item
The type of item that the parallel iterator will produce.
Source§type Iter = <&'a mut T as IntoParallelIterator>::Iter
type Iter = <&'a mut T as IntoParallelIterator>::Iter
The parallel iterator type that will be created.
Source§fn into_par_iter(self) -> <&'a mut ViewMut<T, G> as IntoParallelIterator>::Iter
fn into_par_iter(self) -> <&'a mut ViewMut<T, G> as IntoParallelIterator>::Iter
Converts
self into a parallel iterator. Read moreAuto Trait Implementations§
impl<T, G> Freeze for ViewMut<T, G>
impl<T, G = SomeDefault> !RefUnwindSafe for ViewMut<T, G>
impl<T, G> Send for ViewMut<T, G>
impl<T, G> Sync for ViewMut<T, G>
impl<T, G> Unpin for ViewMut<T, G>
impl<T, G = SomeDefault> !UnwindSafe for ViewMut<T, G>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<'data, I> IntoParallelRefIterator<'data> for I
impl<'data, I> IntoParallelRefIterator<'data> for I
Source§impl<'data, I> IntoParallelRefMutIterator<'data> for I
impl<'data, I> IntoParallelRefMutIterator<'data> for I
Source§type Iter = <&'data mut I as IntoParallelIterator>::Iter
type Iter = <&'data mut I as IntoParallelIterator>::Iter
The type of iterator that will be created.
Source§type Item = <&'data mut I as IntoParallelIterator>::Item
type Item = <&'data mut I as IntoParallelIterator>::Item
The type of item that will be produced; this is typically an
&'data mut T reference.Source§fn par_iter_mut(
&'data mut self,
) -> <I as IntoParallelRefMutIterator<'data>>::Iter
fn par_iter_mut( &'data mut self, ) -> <I as IntoParallelRefMutIterator<'data>>::Iter
Creates the parallel iterator from
self. Read more