pub struct DataFlowInstance { /* private fields */ }Expand description
A DataFlowInstance is an instance of a data flow that is ready to be run.
All Zenoh-Flow daemons involved in the deployment of an instance of a data flow will create this structure to manage the nodes they are responsible for. Each daemon will keep in that structure only their view of the instance.
Implementations§
Source§impl DataFlowInstance
impl DataFlowInstance
Sourcepub fn get_sinks(&self) -> Vec<NodeId> ⓘ
pub fn get_sinks(&self) -> Vec<NodeId> ⓘ
Retrieve the NodeId of the Sinks of this data flow instance running on the current
daemon.
CAVEAT: It is possible (and likely) that not all Sinks run on a single daemon. Hence, this
list will be a subset of the list of all Sinks of this data flow.
Sourcepub fn get_sources(&self) -> Vec<NodeId> ⓘ
pub fn get_sources(&self) -> Vec<NodeId> ⓘ
Retrieve the NodeId of the Sources of this data flow instance running on the current
daemon.
CAVEAT: It is possible (and likely) that not all Sources run on a single daemon. Hence,
this list will be a subset of the list of all Sources of this data flow.
Sourcepub fn get_operators(&self) -> Vec<NodeId> ⓘ
pub fn get_operators(&self) -> Vec<NodeId> ⓘ
Retrieve the NodeId of the Operators of this data flow instance running on the current
daemon.
CAVEAT: It is possible (and likely) that not all Operators run on a single daemon. Hence,
this list will be a subset of the list of all Operators of this data flow.
Sourcepub fn get_connectors(&self) -> Vec<NodeId> ⓘ
pub fn get_connectors(&self) -> Vec<NodeId> ⓘ
Retrieve the NodeId of the ZFConnectors of this data flow instance running on the
current daemon.
CAVEAT: It is possible (and likely) that not all ZFConnectors run on a single daemon.
Hence, this list will be a subset of the list of all ZFConnectors of this data flow.
Sourcepub fn start_node(&mut self, node_id: &NodeId) -> Result<()>
pub fn start_node(&mut self, node_id: &NodeId) -> Result<()>
Start the node whose id matches the one provided.
Start means launching as many tasks as necessary to run continuously the Node, input
and/or output callbacks.
Start is idempotent, if the node is already running, nothing will happen.
§Error
This method can return an error if the provided node_id is not found.
Sourcepub async fn stop_node(&mut self, node_id: &NodeId) -> Result<()>
pub async fn stop_node(&mut self, node_id: &NodeId) -> Result<()>
Stop the node whose id matches the one provided.
Stop means canceling all the tasks that were launched. Note that stop does not interrupt a
currently running task. The task will effectively be stopped the next time it encounters an
await.
Stop is idempotent, if the node is not running, nothing will happen.
§Error
This method can return an error if the provided node_id is not found.
Sourcepub async fn try_instantiate(data_flow: DataFlow, hlc: Arc<HLC>) -> Result<Self>
pub async fn try_instantiate(data_flow: DataFlow, hlc: Arc<HLC>) -> Result<Self>
Given a DataFlow and an HLC, try to instantiate the data flow by generating all the
nodes (via their factories) and all the connections — running on the daemon.
§Error
This function can return an error if:
- some links are missing which resulted in some missing connections,
- a factory failed to generate a node.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DataFlowInstance
impl !RefUnwindSafe for DataFlowInstance
impl Send for DataFlowInstance
impl Sync for DataFlowInstance
impl Unpin for DataFlowInstance
impl !UnwindSafe for DataFlowInstance
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more