Struct Network

Source
pub struct Network { /* private fields */ }

Implementations§

Source§

impl Network

Source

pub fn builder() -> NetworkBuilder

Source

pub fn activities(&self) -> Result<Vec<&str>>

A list of all activities in the precedence network

Source

pub fn edges(&self) -> Result<Vec<(&str, &str)>>

A list of all edges in the precedence network

Source

pub fn connected( &self, origin_reference: &str, target_reference: &str, ) -> Result<bool>

Test whether two activities are connected

Source

pub fn start_activities(&self) -> Result<Vec<&str>>

A list of all start activities

A start activity is an activity with no preceding activities.

Source

pub fn finish_activities(&self) -> Result<Vec<&str>>

A list of all finish activities

A finish activity is an activity with no dependant activities.

Source

pub fn next_activities(&self, reference: &str) -> Result<Vec<&str>>

Returns a list of activities that depend on the completion of the given activity

Source

pub fn previous_activities(&self, reference: &str) -> Result<Vec<&str>>

Returns a list of activities that the given activity depends on

Source

pub fn earliest_finish(&self, reference: &str) -> Result<f64>

The earliest possible finish of an activity

Source

pub fn latest_finish(&self, reference: &str) -> Result<f64>

The latest possible finish of an activity

Source

pub fn latest_start(&self, reference: &str) -> Result<f64>

The latest possible start of an activity

Source

pub fn earliest_start(&self, reference: &str) -> Result<f64>

The earliest possible start of an activity

Source

pub fn on_critical_path(&self, reference: &str) -> Result<bool>

Returns true if the given activity is on the critical path

Source

pub fn critical_path_activities(&self) -> Result<Vec<&str>>

A list of all activities on the critical path

Source

pub fn total_float(&self, reference: &str) -> Result<f64>

The total float (or slack) of an activity

Slack is how much the activity can be delayed to not cause the final completion time of all activities to be delayed.

Source

pub fn free_float(&self, reference: &str) -> Result<f64>

The free (or early) float of an activity

The free float is how much the activity can be delayed to not cause a delay in the earliest start of any subsequent activity.

Source

pub fn start(&self, reference: &str) -> Result<f64>

The start of an activity, which can vary depending on how activity_type was set

Source

pub fn finish(&self, reference: &str) -> Result<f64>

The finish time of an activity, which can vary depending on how activity_type was set

Source

pub fn active_at(&self, reference: &str, time: f64) -> Result<bool>

Whether an activity is active at a certain time

Source

pub fn active_during(&self, reference: &str, range: Range<f64>) -> Result<bool>

Whether an activity is active during a certain time range

Source

pub fn mean_duration(&self, reference: &str) -> Result<f64>

The mean duration of the activity

The mean is calculated as: ((4 * expected_duration) + minimum_duration + maximum_duration) / 6

Source

pub fn variance(&self, reference: &str) -> Result<f64>

The variance of the duration of the activity

The variance is calculated as: variance ** 2

Source

pub fn standard_deviation(&self, reference: &str) -> Result<f64>

The standard deviation of the duration of the activity

This is calculated as: (maximum_duration - minimum_duration) / 6

Source

pub fn depth(&self, reference: &str) -> Result<usize>

The depth is a measure of how far the activity is from the start

All start activities have depth 1 and all other activities have depth of the maximum depth of their preceding activities + 1.

Source

pub fn to_dot(&self) -> Result<String>

Returns a string containing a representation suitable for dot and other programs in the GraphViz package.

Source

pub fn update_activity<F>( self, reference: &str, with_activity_builder: F, ) -> Result<Network>
where F: FnOnce(&mut ActivityBuilder),

Trait Implementations§

Source§

impl Clone for Network

Source§

fn clone(&self) -> Network

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Network

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Network

Source§

fn default() -> Network

Returns the “default value” for a type. Read more
Source§

impl From<&Network> for NetworkBuilder

Source§

fn from(network: &Network) -> NetworkBuilder

Converts to this type from the input type.
Source§

impl From<Network> for NetworkBuilder

Source§

fn from(network: Network) -> NetworkBuilder

Converts to this type from the input type.
Source§

impl TryFrom<&mut NetworkBuilder> for Network

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from( network_builder: &mut NetworkBuilder, ) -> Result<Network, Self::Error>

Performs the conversion.
Source§

impl TryFrom<NetworkBuilder> for Network

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(network_builder: NetworkBuilder) -> Result<Network, Self::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.