KernelHandleInner

Trait KernelHandleInner 

pub trait KernelHandleInner: Send + Sync {
Show 13 methods // Required methods fn kernel_id_num(&self) -> u64; fn current_timestamp(&self) -> HlcTimestamp; fn activate<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), RingKernelError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn deactivate<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), RingKernelError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn terminate<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), RingKernelError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn send_envelope<'life0, 'async_trait>( &'life0 self, envelope: MessageEnvelope, ) -> Pin<Box<dyn Future<Output = Result<(), RingKernelError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn receive<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<MessageEnvelope, RingKernelError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn receive_timeout<'life0, 'async_trait>( &'life0 self, timeout: Duration, ) -> Pin<Box<dyn Future<Output = Result<MessageEnvelope, RingKernelError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn try_receive(&self) -> Result<MessageEnvelope, RingKernelError>; fn receive_correlated<'life0, 'async_trait>( &'life0 self, correlation: CorrelationId, timeout: Duration, ) -> Pin<Box<dyn Future<Output = Result<MessageEnvelope, RingKernelError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn status(&self) -> KernelStatus; fn metrics(&self) -> KernelMetrics; fn wait<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), RingKernelError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait;
}
Expand description

Inner trait for kernel handle implementation.

This is implemented by each backend to provide the actual functionality.

Required Methods§

fn kernel_id_num(&self) -> u64

Get numeric kernel ID.

fn current_timestamp(&self) -> HlcTimestamp

Get current timestamp.

fn activate<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), RingKernelError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Activate kernel.

fn deactivate<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), RingKernelError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Deactivate kernel.

fn terminate<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), RingKernelError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Terminate kernel.

fn send_envelope<'life0, 'async_trait>( &'life0 self, envelope: MessageEnvelope, ) -> Pin<Box<dyn Future<Output = Result<(), RingKernelError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Send message envelope.

fn receive<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<MessageEnvelope, RingKernelError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Receive message.

fn receive_timeout<'life0, 'async_trait>( &'life0 self, timeout: Duration, ) -> Pin<Box<dyn Future<Output = Result<MessageEnvelope, RingKernelError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Receive with timeout.

fn try_receive(&self) -> Result<MessageEnvelope, RingKernelError>

Try receive (non-blocking).

fn receive_correlated<'life0, 'async_trait>( &'life0 self, correlation: CorrelationId, timeout: Duration, ) -> Pin<Box<dyn Future<Output = Result<MessageEnvelope, RingKernelError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Receive correlated response.

fn status(&self) -> KernelStatus

Get status.

fn metrics(&self) -> KernelMetrics

Get metrics.

fn wait<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), RingKernelError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Wait for termination.

Implementations on Foreign Types§

§

impl KernelHandleInner for CpuKernel

§

fn kernel_id_num(&self) -> u64

§

fn current_timestamp(&self) -> HlcTimestamp

§

fn activate<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), RingKernelError>> + Send + 'async_trait>>
where 'life0: 'async_trait, CpuKernel: 'async_trait,

§

fn deactivate<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), RingKernelError>> + Send + 'async_trait>>
where 'life0: 'async_trait, CpuKernel: 'async_trait,

§

fn terminate<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), RingKernelError>> + Send + 'async_trait>>
where 'life0: 'async_trait, CpuKernel: 'async_trait,

§

fn send_envelope<'life0, 'async_trait>( &'life0 self, envelope: MessageEnvelope, ) -> Pin<Box<dyn Future<Output = Result<(), RingKernelError>> + Send + 'async_trait>>
where 'life0: 'async_trait, CpuKernel: 'async_trait,

§

fn receive<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<MessageEnvelope, RingKernelError>> + Send + 'async_trait>>
where 'life0: 'async_trait, CpuKernel: 'async_trait,

§

fn receive_timeout<'life0, 'async_trait>( &'life0 self, timeout: Duration, ) -> Pin<Box<dyn Future<Output = Result<MessageEnvelope, RingKernelError>> + Send + 'async_trait>>
where 'life0: 'async_trait, CpuKernel: 'async_trait,

§

fn try_receive(&self) -> Result<MessageEnvelope, RingKernelError>

§

fn receive_correlated<'life0, 'async_trait>( &'life0 self, correlation: CorrelationId, timeout: Duration, ) -> Pin<Box<dyn Future<Output = Result<MessageEnvelope, RingKernelError>> + Send + 'async_trait>>
where 'life0: 'async_trait, CpuKernel: 'async_trait,

§

fn status(&self) -> KernelStatus

§

fn metrics(&self) -> KernelMetrics

§

fn wait<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), RingKernelError>> + Send + 'async_trait>>
where 'life0: 'async_trait, CpuKernel: 'async_trait,

Implementors§