Struct KernelHandle
pub struct KernelHandle {
id: KernelId,
inner: Arc<dyn KernelHandleInner>,
}Expand description
Handle to a launched kernel.
Provides an ergonomic API for interacting with a kernel.
Fields§
§id: KernelId§inner: Arc<dyn KernelHandleInner>Implementations§
§impl KernelHandle
impl KernelHandle
pub fn new(id: KernelId, inner: Arc<dyn KernelHandleInner>) -> KernelHandle
pub fn new(id: KernelId, inner: Arc<dyn KernelHandleInner>) -> KernelHandle
Create a new kernel handle.
pub async fn activate(&self) -> Result<(), RingKernelError>
pub async fn activate(&self) -> Result<(), RingKernelError>
Activate the kernel.
pub async fn deactivate(&self) -> Result<(), RingKernelError>
pub async fn deactivate(&self) -> Result<(), RingKernelError>
Deactivate the kernel.
pub async fn terminate(&self) -> Result<(), RingKernelError>
pub async fn terminate(&self) -> Result<(), RingKernelError>
Terminate the kernel.
pub async fn send<M>(&self, message: M) -> Result<(), RingKernelError>where
M: RingMessage,
pub async fn send<M>(&self, message: M) -> Result<(), RingKernelError>where
M: RingMessage,
Send a message to the kernel.
pub async fn send_envelope(
&self,
envelope: MessageEnvelope,
) -> Result<(), RingKernelError>
pub async fn send_envelope( &self, envelope: MessageEnvelope, ) -> Result<(), RingKernelError>
Send a raw envelope.
pub async fn receive(&self) -> Result<MessageEnvelope, RingKernelError>
pub async fn receive(&self) -> Result<MessageEnvelope, RingKernelError>
Receive a message from the kernel.
pub async fn receive_timeout(
&self,
timeout: Duration,
) -> Result<MessageEnvelope, RingKernelError>
pub async fn receive_timeout( &self, timeout: Duration, ) -> Result<MessageEnvelope, RingKernelError>
Receive a message with timeout.
pub fn try_receive(&self) -> Result<MessageEnvelope, RingKernelError>
pub fn try_receive(&self) -> Result<MessageEnvelope, RingKernelError>
Try to receive a message (non-blocking).
pub async fn call<M>(
&self,
message: M,
timeout: Duration,
) -> Result<MessageEnvelope, RingKernelError>where
M: RingMessage,
pub async fn call<M>(
&self,
message: M,
timeout: Duration,
) -> Result<MessageEnvelope, RingKernelError>where
M: RingMessage,
Send request and wait for response (call pattern).
pub fn status(&self) -> KernelStatus
pub fn status(&self) -> KernelStatus
Get kernel status.
pub fn metrics(&self) -> KernelMetrics
pub fn metrics(&self) -> KernelMetrics
Get kernel metrics.
pub async fn wait(&self) -> Result<(), RingKernelError>
pub async fn wait(&self) -> Result<(), RingKernelError>
Wait for kernel to terminate.
pub fn state(&self) -> KernelState
pub fn state(&self) -> KernelState
Get the current kernel state.
This is a convenience method that returns just the state from status().
pub async fn suspend(&self) -> Result<(), RingKernelError>
pub async fn suspend(&self) -> Result<(), RingKernelError>
Suspend (deactivate) the kernel.
This is an alias for deactivate() for more intuitive API usage.
pub async fn resume(&self) -> Result<(), RingKernelError>
pub async fn resume(&self) -> Result<(), RingKernelError>
Resume (activate) the kernel.
This is an alias for activate() for more intuitive API usage.
pub fn is_terminated(&self) -> bool
pub fn is_terminated(&self) -> bool
Check if the kernel has terminated.
Trait Implementations§
§impl Clone for KernelHandle
impl Clone for KernelHandle
§fn clone(&self) -> KernelHandle
fn clone(&self) -> KernelHandle
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for KernelHandle
impl !RefUnwindSafe for KernelHandle
impl Send for KernelHandle
impl Sync for KernelHandle
impl Unpin for KernelHandle
impl !UnwindSafe for KernelHandle
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)