DaemonInterfaceInternal

Trait DaemonInterfaceInternal 

Source
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§

Source

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
Source

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
Source

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
Source

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
Source

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
Source

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
Source

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
Source

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
Source

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
Source

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§

Source

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.

Implementors§