[][src]Struct pns::Net

#[repr(C)]pub struct Net {
    pub transition_count: u32,
    pub place_count: u32,
    // some fields omitted
}

A type representing a petri net. It only stores the initial state, not the state used for simulatoin.

Fields

transition_count: u32

The count of transitions of the petri net

place_count: u32

The count of places of the petri net

Methods

impl Net[src]

pub fn new() -> Net[src]

Create a new, empty petri net.

pub fn load(filename: &str) -> Option<Net>[src]

Load a petri net from a file.

pub fn remove_transition(&mut self, tid: u32)[src]

Remove a transition at index tid from petri net.

pub fn connect_in(&mut self, tid: u32, pid: u32) -> bool[src]

Make a connection into transition with index tid from place with index pid. Result represents success.

pub fn disconnect_out(&mut self, tid: u32, pid: u32)[src]

Remove the connection out from transition with index tid to place with index pid.

Trait Implementations

impl Clone for Net[src]

impl Debug for Net[src]

impl Drop for Net[src]

impl SafeNet for Net[src]

Auto Trait Implementations

impl RefUnwindSafe for Net

impl !Send for Net

impl !Sync for Net

impl Unpin for Net

impl UnwindSafe for Net

Blanket Implementations

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

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.