pub struct NetworkBuilder { /* private fields */ }
Implementations§
Source§impl NetworkBuilder
impl NetworkBuilder
Sourcepub fn add_activity(&mut self, reference: &str, duration: f64) -> Result<()>
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
.
Sourcepub fn remove_activity(&mut self, reference: &str) -> Result<()>
pub fn remove_activity(&mut self, reference: &str) -> Result<()>
Removes an activity and all edges associated with it
pub fn remove_edge( &mut self, origin_reference: &str, target_reference: &str, ) -> Result<()>
Sourcepub 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<()>
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)?;
Sourcepub fn connect(
&mut self,
origin_reference: &str,
target_reference: &str,
) -> Result<()>
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")?;
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
impl Default for NetworkBuilder
Source§fn default() -> NetworkBuilder
fn default() -> NetworkBuilder
Returns the “default value” for a type. Read more
Source§impl From<&Network> for NetworkBuilder
impl From<&Network> for NetworkBuilder
Source§fn from(network: &Network) -> NetworkBuilder
fn from(network: &Network) -> NetworkBuilder
Converts to this type from the input type.
Source§impl From<Network> for NetworkBuilder
impl From<Network> for NetworkBuilder
Source§fn from(network: Network) -> NetworkBuilder
fn from(network: Network) -> NetworkBuilder
Converts to this type from the input type.
Source§impl TryFrom<&mut NetworkBuilder> for Network
impl TryFrom<&mut NetworkBuilder> for Network
Auto Trait Implementations§
impl Freeze for NetworkBuilder
impl RefUnwindSafe for NetworkBuilder
impl Send for NetworkBuilder
impl Sync for NetworkBuilder
impl Unpin for NetworkBuilder
impl UnwindSafe for NetworkBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more