mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-05 06:01:32 +00:00
24 lines
590 B
Rust
24 lines
590 B
Rust
![]() |
use anyhow::Result;
|
||
|
use krata::v1::control::{ReadHypervisorConsoleReply, ReadHypervisorConsoleRequest};
|
||
|
use kratart::Runtime;
|
||
|
|
||
|
pub struct ReadHypervisorConsoleRpc {
|
||
|
runtime: Runtime,
|
||
|
}
|
||
|
|
||
|
impl ReadHypervisorConsoleRpc {
|
||
|
pub fn new(runtime: Runtime) -> Self {
|
||
|
Self { runtime }
|
||
|
}
|
||
|
|
||
|
pub async fn process(
|
||
|
self,
|
||
|
_: ReadHypervisorConsoleRequest,
|
||
|
) -> Result<ReadHypervisorConsoleReply> {
|
||
|
let data = self.runtime.read_hypervisor_console(false).await?;
|
||
|
Ok(ReadHypervisorConsoleReply {
|
||
|
data: data.to_string(),
|
||
|
})
|
||
|
}
|
||
|
}
|