Struct flowcore::model::runtime_function::RuntimeFunction
source · 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
impl RuntimeFunction
sourcepub fn new<I: Into<String>>(
implementation_location: I,
inputs: Vec<Input>,
id: usize,
flow_id: usize,
output_connections: &[OutputConnection],
include_destination_routes: bool
) -> Self
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
sourcepub fn get_flow_id(&self) -> usize
pub fn get_flow_id(&self) -> usize
Accessor for a RuntimeFunction
flow_id
sourcepub fn init_inputs(&mut self, first_time: bool, flow_idle: bool)
pub fn init_inputs(&mut self, first_time: bool, flow_idle: bool)
Initialize Inputs
that have InputInitializers
on them
sourcepub fn implementation_location(&self) -> &str
pub fn implementation_location(&self) -> &str
Accessor for a RuntimeFunction
implementation_location
sourcepub fn send(&mut self, io_number: usize, value: Value) -> bool
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
sourcepub fn get_output_connections(&self) -> &Vec<OutputConnection>
pub fn get_output_connections(&self) -> &Vec<OutputConnection>
Accessor for a RuntimeFunction
output_connections
field
sourcepub fn get_implementation_location(&self) -> &str
pub fn get_implementation_location(&self) -> &str
Get a reference to the implementation_location
sourcepub fn set_implementation_url(&mut self, manifest_url: &Url) -> Result<()>
pub fn set_implementation_url(&mut self, manifest_url: &Url) -> Result<()>
Set the implementation_location, as an absolute Url relative to the manifest_url
sourcepub fn get_implementation_url(&self) -> &Url
pub fn get_implementation_url(&self) -> &Url
Get a reference to the implementation_url
sourcepub fn values_available(&self, input_number: usize) -> usize
pub fn values_available(&self, input_number: usize) -> usize
Returns the number of values available on RuntimeFunction’s Input number input_number
sourcepub fn input_sets_available(&self) -> usize
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
sourcepub fn can_run(&self) -> bool
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
sourcepub fn take_input_set(&mut self) -> Option<Vec<Value>>
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
sourcepub fn is_always_ready(&self) -> bool
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
impl Clone for RuntimeFunction
source§fn clone(&self) -> RuntimeFunction
fn clone(&self) -> RuntimeFunction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for RuntimeFunction
impl Debug for RuntimeFunction
source§impl<'de> Deserialize<'de> for RuntimeFunction
impl<'de> Deserialize<'de> for RuntimeFunction
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl PartialEq for RuntimeFunction
impl PartialEq for RuntimeFunction
source§fn eq(&self, other: &RuntimeFunction) -> bool
fn eq(&self, other: &RuntimeFunction) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for RuntimeFunction
impl Serialize for RuntimeFunction
impl Eq for RuntimeFunction
impl StructuralEq for RuntimeFunction
impl StructuralPartialEq for RuntimeFunction
Auto Trait Implementations§
impl RefUnwindSafe for RuntimeFunction
impl Send for RuntimeFunction
impl Sync for RuntimeFunction
impl Unpin for RuntimeFunction
impl UnwindSafe for RuntimeFunction
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.