cycles-quartz/enclaves/quartz/src/server.rs

22 lines
578 B
Rust
Raw Normal View History

2024-02-20 16:34:42 +00:00
use quartz_proto::quartz::{core_server::Core, SessionCreateRequest, SessionCreateResponse};
2024-02-20 11:27:10 +00:00
use tonic::{Request, Response, Status};
#[derive(Debug, Default)]
pub struct CoreService {}
#[tonic::async_trait]
impl Core for CoreService {
async fn session_create(
&self,
request: Request<SessionCreateRequest>,
) -> Result<Response<SessionCreateResponse>, Status> {
println!("Got a request: {:?}", request);
let reply = SessionCreateResponse {
message: "Hello!".to_string(),
};
Ok(Response::new(reply))
}
}