pub struct DataFlow { /* private fields */ }Expand description
DataFlow is an intermediate structure which primary purpose is to store the loaded libraries.
This intermediate structure is needed to create data flows programmatically. It is mostly used internally to assess the performance of Zenoh-Flow.
End users should not use it directly: no verifications to ensure the validity of the data flow are performed at this step or in the next ones.
Implementations§
Source§impl DataFlow
impl DataFlow
Sourcepub fn new(name: impl AsRef<str>, context: RuntimeContext) -> Self
pub fn new(name: impl AsRef<str>, context: RuntimeContext) -> Self
Create a new empty DataFlow named name with the provided RuntimeContext.
Unless you know very well what you are doing, you should not use this function.
This function is the entry point to create a data flow programmatically. It should not be called by end users.
Sourcepub fn add_source(&mut self, record: SourceRecord, constructor: SourceFn)
pub fn add_source(&mut self, record: SourceRecord, constructor: SourceFn)
Add a Source to the DataFlow.
Unless you know very well what you are doing, you should not use this method.
If the Source is not correctly connected to downstream nodes, its data will never be received.
Sourcepub fn add_operator(&mut self, record: OperatorRecord, constructor: OperatorFn)
pub fn add_operator(&mut self, record: OperatorRecord, constructor: OperatorFn)
Add an Operator to the DataFlow.
Unless you know very well what you are doing, you should not use this method.
If the Operator is not correctly connected to upstream and downstream nodes, it will never receive, process and emit data.
Sourcepub fn add_sink(&mut self, record: SinkRecord, constructor: SinkFn)
pub fn add_sink(&mut self, record: SinkRecord, constructor: SinkFn)
Add a Sink to the DataFlow.
Unless you know very well what you are doing, you should not use this method.
If the Sink is not correctly connected to upstream nodes, it will never receive data.
Sourcepub fn add_link(&mut self, from: OutputDescriptor, to: InputDescriptor)
pub fn add_link(&mut self, from: OutputDescriptor, to: InputDescriptor)
Add a Link to the DataFlow.
Unless you know very well what you are doing, you should not use this method.
If the OutputDescriptor and InputDescriptor are incorrect, Zenoh-Flow will error out at
runtime.
Sourcepub fn try_new(
record: DataFlowRecord,
context: RuntimeContext,
) -> ZFResult<Self>
pub fn try_new( record: DataFlowRecord, context: RuntimeContext, ) -> ZFResult<Self>
Given a DataFlowRecord, create the corresponding DataFlow by dynamically loading the
shared libraries.
§Error
Failures can happen when trying to load node factories.
Auto Trait Implementations§
impl Freeze for DataFlow
impl !RefUnwindSafe for DataFlow
impl Send for DataFlow
impl Sync for DataFlow
impl Unpin for DataFlow
impl !UnwindSafe for DataFlow
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