[][src]Struct pns::SimulatedNet

pub struct SimulatedNet { /* fields omitted */ }

A wrapper type for net to support managing multiple states for simulations.

Methods

impl SimulatedNet[src]

pub fn new(net: Net) -> SimulatedNet[src]

Convert a Net to a SimulatedNet for advanced simulation.

pub fn with_ref<'net, F: FnMut(&'net Net, &Vec<State<'net>>)>(&self, f: F) where
    Self: 'net, 
[src]

Call methods on the net and and a vector of states of it. To fill the vector use with.

pub fn with<'net, F: FnMut(&'net Net, &mut Vec<State<'net>>)>(&mut self, f: F) where
    Self: 'net, 
[src]

Call methods on the net and and a mutable vector of states of it. This way new states can be added to the vector.

pub fn add<'net, F: FnMut(&'net Net) -> State<'net>>(&mut self, f: F) where
    Self: 'net, 
[src]

Supply a closure to it, which takes a reference to a net nad create a state to be added. This way it's even easier to add elements to a net.

pub fn add_state<'net>(&mut self) where
    Self: 'net, 
[src]

A simple way to add a default state to the net.

pub fn len(&self) -> usize[src]

Calculate the number of states.

pub fn states<'net>(&'net self) -> &[State<'net>][src]

Access all states.

pub fn states_mut<'net>(&'net mut self) -> &mut [State<'net>][src]

Access all states mutable.

pub fn release(self) -> Net[src]

Release the Net from the SimulatedNet again.

Methods from Deref<Target = Net>

Trait Implementations

impl SafeNet for SimulatedNet[src]

impl Deref for SimulatedNet[src]

type Target = Net

The resulting type after dereferencing.

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]