Struct NetworkBuilder

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

Implementations§

Source§

impl NetworkBuilder

Source

pub fn add_activity(&mut self, reference: &str, duration: f64) -> Result<()>

Add an activity to the network.

The reference and description of the activity will be set to reference. The minimum_duration, expected_duration and maximum_duration will all be set to duration. The start_type will be set to StartType::Earliest and the duration_type will be set to DurationType::Expected.

Source

pub fn remove_activity(&mut self, reference: &str) -> Result<()>

Removes an activity and all edges associated with it

Source

pub fn remove_edge( &mut self, origin_reference: &str, target_reference: &str, ) -> Result<()>

Source

pub fn add_extended_activity( &mut self, reference: &str, description: &str, minimum_duration: f64, expected_duration: f64, maximum_duration: f64, start_type: StartType, duration_type: DurationType, ) -> Result<()>

Add a customised activity to the network.

This method is for creating activities with differing durations, start types or duration types.

network_builder.add_extended_activity("develop",
                                      "Develop System",
                                      1.0, 3.0, 5.0,
                                      StartType::Earliest,
                                      DurationType::Expected)?;
Source

pub fn connect( &mut self, origin_reference: &str, target_reference: &str, ) -> Result<()>

Connect two activities together

// a -> b -> c
network_builder.connect("a", "b")?;
network_builder.connect("b", "c")?;
Source

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

Trait Implementations§

Source§

impl Default for NetworkBuilder

Source§

fn default() -> NetworkBuilder

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> 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, 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.