Struct Job

Source
pub struct Job {
    pub nodes: Vec<Arc<Box<dyn Node>>>,
    /* private fields */
}
Expand description

Job represents the workflow whilst it is running.

When a job is created from a workflow, all of the nodes are converted from a generic Node struct to specific structs which represent only the data required for each node and each struct has it’s own implementation of what it should do when it is run.

Fields§

§nodes: Vec<Arc<Box<dyn Node>>>

A list of all the nodes within the job, each node shown in a workflow will appear exactly once These nodes are wrapped in Arc so they can be sent across thread boundaries safely

Implementations§

Source§

impl Job

Source

pub fn new( wf: &Workflow, reactor_tx: &Sender<Event>, ) -> (Self, Receiver<Message>)

Creates a new Job struct from a Workflow. Also requires the sender to the reactor for any activity nodes that this will create as part of the Job struct. Will also own the Receiver to the executor channel so nodes can send data to it. Need to add position as property to each node Flatten pointer map to quickly scan for a nodes dependencies

Source

pub fn next_node( &self, pointer: Option<usize>, ) -> Option<Vec<Arc<Box<dyn Node>>>>

This will return the next nodes being pointed to by the one that has just completed

This takes an optional pointer to the node which has just completed and then based off that will return the nodes which are pointed to from the one that has just completed.

If we are at the start of the job then we can pass in None to signify this and it will return the Start node.

This will return more than one node in the cases where multiple nodes are pointed to from the node that just completed. This covers cases such as opening parallel nodes and exclusives which can point to multiple nodes.

This will return None when it has reached an End node to signify there are no more nodes to be run.

Trait Implementations§

Source§

impl Clone for Job

Source§

fn clone(&self) -> Job

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

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Job

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Job

§

impl !RefUnwindSafe for Job

§

impl Send for Job

§

impl Sync for Job

§

impl Unpin for Job

§

impl !UnwindSafe for Job

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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V