pub trait DaemonInterfaceInternal: Clone {
// Required methods
fn prepare(
&self,
instance_id: Uuid,
) -> Pin<Box<dyn Future<Output = DaemonResult<DataFlowRecord>> + Send + '_>>;
fn clean(
&self,
instance_id: Uuid,
) -> Pin<Box<dyn Future<Output = DaemonResult<DataFlowRecord>> + Send + '_>>;
fn start(
&self,
instance_id: Uuid,
) -> Pin<Box<dyn Future<Output = DaemonResult<()>> + Send + '_>>;
fn start_sources(
&self,
instance_id: Uuid,
) -> Pin<Box<dyn Future<Output = DaemonResult<()>> + Send + '_>>;
fn stop(
&self,
instance_id: Uuid,
) -> Pin<Box<dyn Future<Output = DaemonResult<()>> + Send + '_>>;
fn stop_sources(
&self,
instance_id: Uuid,
) -> Pin<Box<dyn Future<Output = DaemonResult<()>> + Send + '_>>;
fn notify_runtime(
&self,
instance_id: Uuid,
runtime: String,
message: ControlMessage,
) -> Pin<Box<dyn Future<Output = DaemonResult<()>> + Send + '_>>;
fn check_operator_compatibility(
&self,
operator: OperatorDescriptor,
) -> Pin<Box<dyn Future<Output = DaemonResult<bool>> + Send + '_>>;
fn check_source_compatibility(
&self,
source: SourceDescriptor,
) -> Pin<Box<dyn Future<Output = DaemonResult<bool>> + Send + '_>>;
fn check_sink_compatibility(
&self,
sink: SinkDescriptor,
) -> Pin<Box<dyn Future<Output = DaemonResult<bool>> + Send + '_>>;
// Provided method
fn get_daemon_interface_internal_server(
self,
z: Arc<Session>,
id: Option<ZenohId>,
) -> ServeDaemonInterfaceInternal<Self> { ... }
}Expand description
The interface the Daemon expose to other daemons. The service is exposed using zenoh-rpc, the server and client are generated automatically.
Required Methods§
Sourcefn prepare(
&self,
instance_id: Uuid,
) -> Pin<Box<dyn Future<Output = DaemonResult<DataFlowRecord>> + Send + '_>>
fn prepare( &self, instance_id: Uuid, ) -> Pin<Box<dyn Future<Output = DaemonResult<DataFlowRecord>> + Send + '_>>
Prepares the runtime host the instance identified by the Uuid.
Preparing a runtime means, fetch the operators/source/sinks libraries,
create the needed structures in memory, the links.
Once everything is prepared the runtime should return the DataFlowRecord
§Errors
An error variant is returned in case of:
- error on zenoh-rpc
- unable to prepare
Sourcefn clean(
&self,
instance_id: Uuid,
) -> Pin<Box<dyn Future<Output = DaemonResult<DataFlowRecord>> + Send + '_>>
fn clean( &self, instance_id: Uuid, ) -> Pin<Box<dyn Future<Output = DaemonResult<DataFlowRecord>> + Send + '_>>
Cleans the “remains” of the given instance: unload the libraries, drop data structures and destroy links.
§Errors
An error variant is returned in case of:
- error on zenoh-rpc
- unable to clean
Sourcefn start(
&self,
instance_id: Uuid,
) -> Pin<Box<dyn Future<Output = DaemonResult<()>> + Send + '_>>
fn start( &self, instance_id: Uuid, ) -> Pin<Box<dyn Future<Output = DaemonResult<()>> + Send + '_>>
Starts the sinks, connectors, and operators for the given instance.
§Errors
An error variant is returned in case of:
- error on zenoh-rpc
- instance not found
- instance already started
Sourcefn start_sources(
&self,
instance_id: Uuid,
) -> Pin<Box<dyn Future<Output = DaemonResult<()>> + Send + '_>>
fn start_sources( &self, instance_id: Uuid, ) -> Pin<Box<dyn Future<Output = DaemonResult<()>> + Send + '_>>
Starts the sources for the given instance.
Note that this should be called only after the start(instance) has returned
successfully otherwise data may be lost.
§Errors
An error variant is returned in case of:
- error on zenoh-rpc
- instance not found
- sources already started
Sourcefn stop(
&self,
instance_id: Uuid,
) -> Pin<Box<dyn Future<Output = DaemonResult<()>> + Send + '_>>
fn stop( &self, instance_id: Uuid, ) -> Pin<Box<dyn Future<Output = DaemonResult<()>> + Send + '_>>
Stops the sinks, connectors, and operators for the given instance.
Note that this should be called after the stop_sources(instance) has returned
successfully otherwise data may be lost.
§Errors
An error variant is returned in case of:
- error on zenoh-rpc
- instance not found
- instance already stopped
Sourcefn stop_sources(
&self,
instance_id: Uuid,
) -> Pin<Box<dyn Future<Output = DaemonResult<()>> + Send + '_>>
fn stop_sources( &self, instance_id: Uuid, ) -> Pin<Box<dyn Future<Output = DaemonResult<()>> + Send + '_>>
Stops the sources for the given instance.
§Errors
An error variant is returned in case of:
- error on zenoh-rpc
- instance not found
- sources already stopped
Sourcefn notify_runtime(
&self,
instance_id: Uuid,
runtime: String,
message: ControlMessage,
) -> Pin<Box<dyn Future<Output = DaemonResult<()>> + Send + '_>>
fn notify_runtime( &self, instance_id: Uuid, runtime: String, message: ControlMessage, ) -> Pin<Box<dyn Future<Output = DaemonResult<()>> + Send + '_>>
Sends the message to node for the given instance.
This is useful for sending out-of-band notification to a node (eg. in the case of deadline miss notification).
§Errors
An error variant is returned in case of:
- error on zenoh-rpc
- instance not found
Sourcefn check_operator_compatibility(
&self,
operator: OperatorDescriptor,
) -> Pin<Box<dyn Future<Output = DaemonResult<bool>> + Send + '_>>
fn check_operator_compatibility( &self, operator: OperatorDescriptor, ) -> Pin<Box<dyn Future<Output = DaemonResult<bool>> + Send + '_>>
Checks the compatibility for the given operator.
Compatibility is based on tags and some machine characteristics (eg. CPU architecture, OS).
§Errors
An error variant is returned in case of:
- error on zenoh-rpc
Sourcefn check_source_compatibility(
&self,
source: SourceDescriptor,
) -> Pin<Box<dyn Future<Output = DaemonResult<bool>> + Send + '_>>
fn check_source_compatibility( &self, source: SourceDescriptor, ) -> Pin<Box<dyn Future<Output = DaemonResult<bool>> + Send + '_>>
Checks the compatibility for the given source.
Compatibility is based on tags and some machine characteristics (eg. CPU architecture, OS)
§Errors
An error variant is returned in case of:
- error on zenoh-rpc
Sourcefn check_sink_compatibility(
&self,
sink: SinkDescriptor,
) -> Pin<Box<dyn Future<Output = DaemonResult<bool>> + Send + '_>>
fn check_sink_compatibility( &self, sink: SinkDescriptor, ) -> Pin<Box<dyn Future<Output = DaemonResult<bool>> + Send + '_>>
Checks the compatibility for the given sink.
Compatibility is based on tags and some machine characteristics (eg. CPU architecture, OS)
§Errors
An error variant is returned in case of:
- error on zenoh-rpc
Provided Methods§
Sourcefn get_daemon_interface_internal_server(
self,
z: Arc<Session>,
id: Option<ZenohId>,
) -> ServeDaemonInterfaceInternal<Self>
fn get_daemon_interface_internal_server( self, z: Arc<Session>, id: Option<ZenohId>, ) -> ServeDaemonInterfaceInternal<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.