pub struct RuntimeFunction { /* private fields */ }
Expand description

RuntimeFunction contains all the information needed about a function and its implementation to be able to execute a flow using it.

Implementations§

source§

impl RuntimeFunction

source

pub fn new<I: Into<String>>( implementation_location: I, inputs: Vec<Input>, id: usize, flow_id: usize, output_connections: &[OutputConnection], include_destination_routes: bool ) -> Self

Create a new RuntimeFunction with the specified name, route, implementation etc. This only needs to be used by compilers or IDE generating manifests with functions The library flowrlib just deserializes them from the manifest The Vector of outputs: Output sub-path (or “”), destination function id, destination function io number, Optional path of destination

source

pub fn id(&self) -> usize

Accessor for a RuntimeFunction id

source

pub fn get_flow_id(&self) -> usize

Accessor for a RuntimeFunction flow_id

source

pub fn init(&mut self)

Initialize the function to be ready to be called during flow execution

source

pub fn init_inputs(&mut self, first_time: bool, flow_idle: bool)

Initialize Inputs that have InputInitializers on them

source

pub fn implementation_location(&self) -> &str

Accessor for a RuntimeFunction implementation_location

source

pub fn send(&mut self, io_number: usize, value: Value) -> bool

Send a value or array of values to the specified input of this function

source

pub fn get_output_connections(&self) -> &Vec<OutputConnection>

Accessor for a RuntimeFunction output_connections field

source

pub fn get_implementation_location(&self) -> &str

Get a reference to the implementation_location

source

pub fn set_implementation_url(&mut self, manifest_url: &Url) -> Result<()>

Set the implementation_location, as an absolute Url relative to the manifest_url

source

pub fn get_implementation_url(&self) -> &Url

Get a reference to the implementation_url

source

pub fn values_available(&self, input_number: usize) -> usize

Returns the number of values available on RuntimeFunction’s Input number input_number

source

pub fn input_sets_available(&self) -> usize

Returns how many jobs can be created for this function with the available inputs NOTE: For Impure functions without inputs (that can always run and produce a value) this will return 1 always

source

pub fn can_run(&self) -> bool

Can this function run? Either because: - it has input sets to allow it to run - it has no inputs and so can always run

source

pub fn inputs(&self) -> &Vec<Input>

Inspect the values of the inputs of a RuntimeFunction

source

pub fn take_input_set(&mut self) -> Option<Vec<Value>>

Read the values from the inputs and return them for use in executing the RuntimeFunction

source

pub fn is_always_ready(&self) -> bool

Will this function always be able to create new jobs no matter what // TODO make this an internal bool on creation!

Trait Implementations§

source§

impl Clone for RuntimeFunction

source§

fn clone(&self) -> RuntimeFunction

Returns a copy 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 RuntimeFunction

source§

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

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

impl<'de> Deserialize<'de> for RuntimeFunction

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq for RuntimeFunction

source§

fn eq(&self, other: &RuntimeFunction) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for RuntimeFunction

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for RuntimeFunction

source§

impl StructuralEq for RuntimeFunction

source§

impl StructuralPartialEq for RuntimeFunction

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,