Struct DataFlowInstance

Source
pub struct DataFlowInstance { /* private fields */ }
Expand description

A DataFlowInstance keeps track of the parts of a data flow managed by the Zenoh-Flow runtime.

A DataFlowInstance structure is thus local to a Zenoh-Flow runtime. For a data flow that spawns on multiple runtimes, there will be one such structure at each runtime.

All instances will share the same record but their internal state will differ.

Implementations§

Source§

impl DataFlowInstance

Source

pub async fn start(&mut self, hlc: &HLC) -> Result<()>

(re-)Starts the DataFlowInstance.

The hlc is required to keep track of when this call was made.

§Errors

This method can fail when attempting to re-start: when re-starting a data flow, the method on_resume is called for each node and is faillible.

Source

pub async fn abort(&mut self, hlc: &HLC)

Aborts the DataFlowInstance.

The hlc is required to keep track of when this call was made.

Source

pub fn state(&self) -> &InstanceState

Returns the state of this DataFlowInstance.

Source

pub fn status(&self, runtime_id: &RuntimeId) -> InstanceStatus

Returns the status of this DataFlowInstance.

This structure was intended as a way to retrieve and display information about the instance. This is what the zfctl tool leverages for its instance status command.

Methods from Deref<Target = DataFlowRecord>§

Source

pub fn instance_id(&self) -> &InstanceId

Returns the unique identifier of this DataFlowRecord.

§Performance

The id is internally stored behind an Arc so there is limited overhead to cloning it.

Source

pub fn name(&self) -> &Arc<str>

Returns the name of the data flow from which this DataFlowRecord was generated.

Source

pub fn mapping(&self) -> &HashMap<RuntimeId, HashSet<NodeId>>

Returns the mapping of the data flow: which Zenoh-Flow runtime manages which set of nodes.

Source

pub fn senders(&self) -> &HashMap<NodeId, SenderRecord>

Returns the set of Senders of the data flow.

A Sender sends data, through a publication on Zenoh, to Receiver(s).

Source

pub fn receivers(&self) -> &HashMap<NodeId, ReceiverRecord>

Returns the set of Receivers of the data flow.

A Receiver receives data, through a subscription on Zenoh, from Sender(s).

Returns the set of links of the data flow: how the nodes are connected.

Compared to links found in a FlattenedDataFlowDescriptor, the links in a DataFlowRecord have been updated to take into account the Sender and Receiver connecting the Zenoh-Flow runtimes.

Source

pub fn sources(&self) -> &HashMap<NodeId, FlattenedSourceDescriptor>

Returns the set of Source(s) of the data flow.

A Source will feed external data in the data flow to be processed by downstream nodes.

Source

pub fn operators(&self) -> &HashMap<NodeId, FlattenedOperatorDescriptor>

Returns the set of Operator(s) of the data flow.

An Operator performs computation on the data it receives, either modifying it or producing new data that it forwards to downstream nodes.

Source

pub fn sinks(&self) -> &HashMap<NodeId, FlattenedSinkDescriptor>

Returns the set of Sink(s) of the data flow.

A Sink exposes the result of the data flow pipeline, such that it can be ingested by external components.

Trait Implementations§

Source§

impl Deref for DataFlowInstance

Source§

type Target = DataFlowRecord

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

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

Source§

fn as_node(&self) -> &T

Source§

impl<T> AsNodeMut<T> for T

Source§

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

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SendSyncAny for T
where T: 'static + Send + Sync,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)

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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,