pub trait DaemonInterface: Clone {
// Required methods
fn create_instance(
&self,
flow: FlattenDataFlowDescriptor,
) -> Pin<Box<dyn Future<Output = DaemonResult<Uuid>> + Send + '_>>;
fn delete_instance(
&self,
instance_id: Uuid,
) -> Pin<Box<dyn Future<Output = DaemonResult<DataFlowRecord>> + Send + '_>>;
fn instantiate(
&self,
flow: FlattenDataFlowDescriptor,
) -> Pin<Box<dyn Future<Output = DaemonResult<Uuid>> + Send + '_>>;
fn teardown(
&self,
instance_id: Uuid,
) -> Pin<Box<dyn Future<Output = DaemonResult<DataFlowRecord>> + Send + '_>>;
fn start_instance(
&self,
instance_id: Uuid,
) -> Pin<Box<dyn Future<Output = DaemonResult<()>> + Send + '_>>;
fn stop_instance(
&self,
instance_id: Uuid,
) -> Pin<Box<dyn Future<Output = DaemonResult<DataFlowRecord>> + Send + '_>>;
fn start_node(
&self,
instance_id: Uuid,
node: String,
) -> Pin<Box<dyn Future<Output = DaemonResult<()>> + Send + '_>>;
fn stop_node(
&self,
instance_id: Uuid,
node: String,
) -> Pin<Box<dyn Future<Output = DaemonResult<()>> + Send + '_>>;
// Provided method
fn get_daemon_interface_server(
self,
z: Arc<Session>,
id: Option<ZenohId>,
) -> ServeDaemonInterface<Self> { ... }
}Expand description
Required Methods§
Sourcefn create_instance(
&self,
flow: FlattenDataFlowDescriptor,
) -> Pin<Box<dyn Future<Output = DaemonResult<Uuid>> + Send + '_>>
fn create_instance( &self, flow: FlattenDataFlowDescriptor, ) -> Pin<Box<dyn Future<Output = DaemonResult<Uuid>> + Send + '_>>
Creates an instance of the given FlattenDataFlowDescriptor1.
This function:
- Generates the instance
Uuid - Maps the flow into the infrastructure
- Creates the associated record
- Stores the record in Zenoh
- Prepares all the involved runtimes to host the data flow instance
Returns the Uuid associated with the instance.
§Errors
An error variant is returned in case of:
- error on zenoh-rpc
- unable to map
- unable to prepare nodes
When the registry will be in place it will take the Flow identifier as parameter ↩
Sourcefn delete_instance(
&self,
instance_id: Uuid,
) -> Pin<Box<dyn Future<Output = DaemonResult<DataFlowRecord>> + Send + '_>>
fn delete_instance( &self, instance_id: Uuid, ) -> Pin<Box<dyn Future<Output = DaemonResult<DataFlowRecord>> + Send + '_>>
Deletes the given instance.
This function:
- Cleans the instance nodes from all the involved runtimes.
- Deletes the record from zenoh
§Errors
An error variant is returned in case of:
- error on zenoh-rpc
- instance not stopped
- unable to clean
- zenoh error
Sourcefn instantiate(
&self,
flow: FlattenDataFlowDescriptor,
) -> Pin<Box<dyn Future<Output = DaemonResult<Uuid>> + Send + '_>>
fn instantiate( &self, flow: FlattenDataFlowDescriptor, ) -> Pin<Box<dyn Future<Output = DaemonResult<Uuid>> + Send + '_>>
Instantiates the given FlattenDataFlowDescriptor1.
The instance contains an Uuid that identifies it uniquely.
The actual instantiation process runs asynchronously in the runtime.
Returns the Uuid associated with the instance.
It is equivalent to calling create_instance and then start_instance.
§Errors
An error variant is returned in case of:
- error on zenoh-rpc
- unable to instantiate
When the registry will be in place it will take the Flow identifier as parameter. ↩
Sourcefn teardown(
&self,
instance_id: Uuid,
) -> Pin<Box<dyn Future<Output = DaemonResult<DataFlowRecord>> + Send + '_>>
fn teardown( &self, instance_id: Uuid, ) -> Pin<Box<dyn Future<Output = DaemonResult<DataFlowRecord>> + Send + '_>>
Sends a teardown request for the given instance identified by the Uuid.
Note that the request is asynchronous, the runtime that receives the request will return immediately, but the teardown process will run asynchronously in the runtime.
It is equivalent to calling stop_instance and then delete_instance.
§Errors
An error variant is returned in case of:
- error on zenoh-rpc
- unable to teardown
- instance not found
Sourcefn start_instance(
&self,
instance_id: Uuid,
) -> Pin<Box<dyn Future<Output = DaemonResult<()>> + Send + '_>>
fn start_instance( &self, instance_id: Uuid, ) -> Pin<Box<dyn Future<Output = DaemonResult<()>> + Send + '_>>
Starts the instance on all involved nodes.
It first starts all the nodes and then the sources.
§Errors
An error variant is returned in case of:
- error on zenoh-rpc
- instance not found
- instance already started
Sourcefn stop_instance(
&self,
instance_id: Uuid,
) -> Pin<Box<dyn Future<Output = DaemonResult<DataFlowRecord>> + Send + '_>>
fn stop_instance( &self, instance_id: Uuid, ) -> Pin<Box<dyn Future<Output = DaemonResult<DataFlowRecord>> + Send + '_>>
Stops the instance on all involved nodes.
It first stops the sources then the other nodes.
§Errors
An error variant is returned in case of:
- error on zenoh-rpc
- unable to clean
Sourcefn start_node(
&self,
instance_id: Uuid,
node: String,
) -> Pin<Box<dyn Future<Output = DaemonResult<()>> + Send + '_>>
fn start_node( &self, instance_id: Uuid, node: String, ) -> Pin<Box<dyn Future<Output = DaemonResult<()>> + Send + '_>>
Starts the given graph node for the given instance. A graph node can be a source, a sink, a connector, or an operator.
§Errors
An error variant is returned in case of:
- error on zenoh-rpc
- record not found
- node already started
- node not found
Sourcefn stop_node(
&self,
instance_id: Uuid,
node: String,
) -> Pin<Box<dyn Future<Output = DaemonResult<()>> + Send + '_>>
fn stop_node( &self, instance_id: Uuid, node: String, ) -> Pin<Box<dyn Future<Output = DaemonResult<()>> + Send + '_>>
Stops the given graph node from the given instance. A graph node can be a source, a sink, a connector, or an operator.
§Errors
An error variant is returned in case of:
- error on zenoh-rpc
- instance not found
- node not found
- node already stopped
Provided Methods§
Sourcefn get_daemon_interface_server(
self,
z: Arc<Session>,
id: Option<ZenohId>,
) -> ServeDaemonInterface<Self>
fn get_daemon_interface_server( self, z: Arc<Session>, id: Option<ZenohId>, ) -> ServeDaemonInterface<Self>
Returns the server object
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.