Skip to main content

KernelHandleInner

Trait KernelHandleInner 

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

Source

fn kernel_id_num(&self) -> u64

Get numeric kernel ID.

Source

fn current_timestamp(&self) -> HlcTimestamp

Get current timestamp.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Try receive (non-blocking).

Source

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.

Source

fn status(&self) -> KernelStatus

Get status.

Source

fn metrics(&self) -> KernelMetrics

Get metrics.

Source

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§

Source§

impl KernelHandleInner for CpuKernel

Source§

fn kernel_id_num(&self) -> u64

Source§

fn current_timestamp(&self) -> HlcTimestamp

Source§

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

Source§

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

Source§

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

Source§

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,

Source§

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,

Source§

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,

Source§

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

Source§

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,

Source§

fn status(&self) -> KernelStatus

Source§

fn metrics(&self) -> KernelMetrics

Source§

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§