feat(protos): use Bytes for protobuf bytes type fields.

This commit is contained in:
Nugine
2025-06-15 21:30:28 +08:00
parent 57cda74fbd
commit 1606276223
9 changed files with 113 additions and 109 deletions
+2 -1
View File
@@ -28,4 +28,5 @@ tower.workspace = true
url.workspace = true
madmin.workspace =true
common.workspace = true
rustfs-filemeta.workspace = true
rustfs-filemeta.workspace = true
bytes.workspace = true
+2 -2
View File
@@ -43,7 +43,7 @@ async fn ping() -> Result<(), Box<dyn Error>> {
// Construct PingRequest
let request = Request::new(PingRequest {
version: 1,
body: finished_data.to_vec(),
body: bytes::Bytes::copy_from_slice(finished_data),
});
// Send request and get response
@@ -114,7 +114,7 @@ async fn walk_dir() -> Result<(), Box<dyn Error>> {
let mut client = node_service_time_out_client(&CLUSTER_ADDR.to_string()).await?;
let request = Request::new(WalkDirRequest {
disk: "/home/dandan/code/rust/s3-rustfs/target/debug/data".to_string(),
walk_dir_options: buf,
walk_dir_options: buf.into(),
});
let mut response = client.walk_dir(request).await?.into_inner();