Skip to content

Commit 0197b36

Browse files
committed
Create collection server impl
1 parent 7cb8c7d commit 0197b36

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

rust/rust-sysdb/src/server.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,21 @@ impl SysDb for SysdbService {
251251

252252
async fn create_collection(
253253
&self,
254-
_request: Request<CreateCollectionRequest>,
254+
request: Request<CreateCollectionRequest>,
255255
) -> Result<Response<CreateCollectionResponse>, Status> {
256-
todo!()
256+
let proto_req = request.into_inner();
257+
let internal_req: internal::CreateCollectionRequest = proto_req
258+
.try_into()
259+
.map_err(|e: SysDbError| Status::from(e))?;
260+
261+
let backend = internal_req.assign(&self.backends);
262+
let internal_resp = internal_req.run(backend).await?;
263+
264+
let proto_resp: CreateCollectionResponse = internal_resp
265+
.try_into()
266+
.map_err(|e: SysDbError| Status::from(e))?;
267+
268+
Ok(Response::new(proto_resp))
257269
}
258270

259271
async fn delete_collection(

0 commit comments

Comments
 (0)