Skip to content

Commit e2e774e

Browse files
authored
chore(rust generation): bump tonic and prost to 0.14 (#68)
1 parent a80b997 commit e2e774e

8 files changed

Lines changed: 158 additions & 156 deletions

File tree

Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ publish = false
1212
[dependencies]
1313
# The version requirements of these must match the version requirement of protoc-rs used to
1414
# generate the code
15-
tonic = "0.13"
16-
prost = "0.13"
17-
prost-types = "0.13"
15+
tonic = "0.14"
16+
prost = "0.14"
17+
tonic-prost = "0.14"
18+
prost-types = "0.14"
1819

1920
[lib]
2021
path = "rust/lib.rs"

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ clean:
5757
PROTOC_VERSION := 29.2
5858
PROTOC_GEN_GO_VERSION := 1.36.2
5959
PROTOC_GEN_GO_GRPC_VERSION := 1.5.1
60-
PROTOC_RS_VERSION := 0.5.0
60+
PROTOC_RS_VERSION := 0.6.0
6161

6262
# Checks the versions of the installed tools, making sure they are what we expect
6363
.PHONY: check-tools

rust/beegfs.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/// The "legacy" BeeGFS numeric Id-NodeType combination that can be used to identify an entity like
33
/// a node or target. Because each entity type has its own id space (meaning a combination is not
44
/// globally unique), the entity type must be known in addition to uniquely identify an entity.
5-
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
5+
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
66
pub struct LegacyId {
77
/// BeeGFS numeric id.
88
/// Required, 0 is invalid.
@@ -17,12 +17,13 @@ pub struct LegacyId {
1717
/// Contains all identifiers used to uniquely identify an entity like a node or a target. Mainly
1818
/// meant for communication with management as management has access to all the information. This
1919
/// message should be used in two ways:
20-
/// 1) In a request message (to the management), only _one_ of the fields needs to be set (each is
21-
/// enough to identify an entity (legacy_id with extra knowledge).
22-
/// 2) In a response message (from the management), _all_ fields should be set. The request processor
23-
/// should have all info about an entity available. If that isn't the case, leaving fields empty is
24-
/// allowed.
25-
#[derive(Clone, PartialEq, ::prost::Message)]
20+
///
21+
/// 1. In a request message (to the management), only *one* of the fields needs to be set (each is
22+
/// enough to identify an entity (legacy_id with extra knowledge).
23+
/// 1. In a response message (from the management), *all* fields should be set. The request processor
24+
/// should have all info about an entity available. If that isn't the case, leaving fields empty is
25+
/// allowed.
26+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2627
pub struct EntityIdSet {
2728
/// The global, unique entity id. Identifies an entity from all types without any additional
2829
/// context.
@@ -32,7 +33,7 @@ pub struct EntityIdSet {
3233
/// The user definable globally unique alias of an entity. Identifies an entity from all types
3334
/// without any additional context.
3435
/// Optional or Required, depending on the use case. Aliases must start with letter and contain
35-
/// only \[a-zA-Z0-9_-.\].
36+
/// only \[a-zA-Z0-9\_-.\].
3637
#[prost(string, optional, tag = "2")]
3738
pub alias: ::core::option::Option<::prost::alloc::string::String>,
3839
/// The "legacy" style numeric Id-NodeType combination. The entity type must be known in addition

rust/beeremote.rs

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ pub struct JobRequest {
106106
}
107107
/// Nested message and enum types in `JobRequest`.
108108
pub mod job_request {
109-
#[derive(Clone, PartialEq, ::prost::Message)]
109+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
110110
pub struct GenerationStatus {
111111
#[prost(enumeration = "generation_status::State", tag = "1")]
112112
pub state: i32,
@@ -224,7 +224,7 @@ pub struct Job {
224224
}
225225
/// Nested message and enum types in `Job`.
226226
pub mod job {
227-
#[derive(Clone, PartialEq, ::prost::Message)]
227+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
228228
pub struct Status {
229229
#[prost(enumeration = "State", tag = "1")]
230230
pub state: i32,
@@ -472,7 +472,7 @@ pub struct UpdateJobsResponse {
472472
/// With the MapStore used as a wrapper around the BadgerDB k/v store we don't
473473
/// have to duplicate all information and can use the Metadata field of the
474474
/// MapStore to create references to data stored in other MapStores.
475-
#[derive(Clone, PartialEq, ::prost::Message)]
475+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
476476
pub struct GetJobsRequest {
477477
#[prost(bool, tag = "4")]
478478
pub include_work_requests: bool,
@@ -493,14 +493,14 @@ pub struct GetJobsRequest {
493493
}
494494
/// Nested message and enum types in `GetJobsRequest`.
495495
pub mod get_jobs_request {
496-
#[derive(Clone, PartialEq, ::prost::Message)]
496+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
497497
pub struct QueryIdAndPath {
498498
#[prost(string, tag = "1")]
499499
pub job_id: ::prost::alloc::string::String,
500500
#[prost(string, tag = "2")]
501501
pub path: ::prost::alloc::string::String,
502502
}
503-
#[derive(Clone, PartialEq, ::prost::Oneof)]
503+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
504504
pub enum Query {
505505
/// Returns at most one Job.
506506
#[prost(message, tag = "1")]
@@ -528,21 +528,21 @@ pub struct UpdateWorkRequest {
528528
}
529529
/// We use our own empty message instead of google.protobuf.Empty to ensure backwards
530530
/// compatibility should we need to add fields in the future.
531-
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
531+
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
532532
pub struct UpdateWorkResponse {}
533-
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
533+
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
534534
pub struct GetRstConfigRequest {}
535535
#[derive(Clone, PartialEq, ::prost::Message)]
536536
pub struct GetRstConfigResponse {
537537
#[prost(message, repeated, tag = "1")]
538538
pub rsts: ::prost::alloc::vec::Vec<super::flex::RemoteStorageTarget>,
539539
}
540-
#[derive(Clone, PartialEq, ::prost::Message)]
540+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
541541
pub struct GetStubContentsRequest {
542542
#[prost(string, tag = "1")]
543543
pub path: ::prost::alloc::string::String,
544544
}
545-
#[derive(Clone, PartialEq, ::prost::Message)]
545+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
546546
pub struct GetStubContentsResponse {
547547
#[prost(uint32, optional, tag = "1")]
548548
pub rst_id: ::core::option::Option<u32>,
@@ -657,7 +657,7 @@ pub mod bee_remote_client {
657657
format!("Service was not ready: {}", e.into()),
658658
)
659659
})?;
660-
let codec = tonic::codec::ProstCodec::default();
660+
let codec = tonic_prost::ProstCodec::default();
661661
let path = http::uri::PathAndQuery::from_static(
662662
"/beeremote.BeeRemote/SubmitJob",
663663
);
@@ -681,7 +681,7 @@ pub mod bee_remote_client {
681681
format!("Service was not ready: {}", e.into()),
682682
)
683683
})?;
684-
let codec = tonic::codec::ProstCodec::default();
684+
let codec = tonic_prost::ProstCodec::default();
685685
let path = http::uri::PathAndQuery::from_static(
686686
"/beeremote.BeeRemote/UpdatePaths",
687687
);
@@ -705,7 +705,7 @@ pub mod bee_remote_client {
705705
format!("Service was not ready: {}", e.into()),
706706
)
707707
})?;
708-
let codec = tonic::codec::ProstCodec::default();
708+
let codec = tonic_prost::ProstCodec::default();
709709
let path = http::uri::PathAndQuery::from_static(
710710
"/beeremote.BeeRemote/UpdateJobs",
711711
);
@@ -729,7 +729,7 @@ pub mod bee_remote_client {
729729
format!("Service was not ready: {}", e.into()),
730730
)
731731
})?;
732-
let codec = tonic::codec::ProstCodec::default();
732+
let codec = tonic_prost::ProstCodec::default();
733733
let path = http::uri::PathAndQuery::from_static(
734734
"/beeremote.BeeRemote/GetJobs",
735735
);
@@ -762,7 +762,7 @@ pub mod bee_remote_client {
762762
format!("Service was not ready: {}", e.into()),
763763
)
764764
})?;
765-
let codec = tonic::codec::ProstCodec::default();
765+
let codec = tonic_prost::ProstCodec::default();
766766
let path = http::uri::PathAndQuery::from_static(
767767
"/beeremote.BeeRemote/UpdateWork",
768768
);
@@ -786,7 +786,7 @@ pub mod bee_remote_client {
786786
format!("Service was not ready: {}", e.into()),
787787
)
788788
})?;
789-
let codec = tonic::codec::ProstCodec::default();
789+
let codec = tonic_prost::ProstCodec::default();
790790
let path = http::uri::PathAndQuery::from_static(
791791
"/beeremote.BeeRemote/GetRSTConfig",
792792
);
@@ -810,7 +810,7 @@ pub mod bee_remote_client {
810810
format!("Service was not ready: {}", e.into()),
811811
)
812812
})?;
813-
let codec = tonic::codec::ProstCodec::default();
813+
let codec = tonic_prost::ProstCodec::default();
814814
let path = http::uri::PathAndQuery::from_static(
815815
"/beeremote.BeeRemote/GetStubContents",
816816
);
@@ -834,7 +834,7 @@ pub mod bee_remote_client {
834834
format!("Service was not ready: {}", e.into()),
835835
)
836836
})?;
837-
let codec = tonic::codec::ProstCodec::default();
837+
let codec = tonic_prost::ProstCodec::default();
838838
let path = http::uri::PathAndQuery::from_static(
839839
"/beeremote.BeeRemote/GetCapabilities",
840840
);
@@ -1041,7 +1041,7 @@ pub mod bee_remote_server {
10411041
let inner = self.inner.clone();
10421042
let fut = async move {
10431043
let method = SubmitJobSvc(inner);
1044-
let codec = tonic::codec::ProstCodec::default();
1044+
let codec = tonic_prost::ProstCodec::default();
10451045
let mut grpc = tonic::server::Grpc::new(codec)
10461046
.apply_compression_config(
10471047
accept_compression_encodings,
@@ -1087,7 +1087,7 @@ pub mod bee_remote_server {
10871087
let inner = self.inner.clone();
10881088
let fut = async move {
10891089
let method = UpdatePathsSvc(inner);
1090-
let codec = tonic::codec::ProstCodec::default();
1090+
let codec = tonic_prost::ProstCodec::default();
10911091
let mut grpc = tonic::server::Grpc::new(codec)
10921092
.apply_compression_config(
10931093
accept_compression_encodings,
@@ -1132,7 +1132,7 @@ pub mod bee_remote_server {
11321132
let inner = self.inner.clone();
11331133
let fut = async move {
11341134
let method = UpdateJobsSvc(inner);
1135-
let codec = tonic::codec::ProstCodec::default();
1135+
let codec = tonic_prost::ProstCodec::default();
11361136
let mut grpc = tonic::server::Grpc::new(codec)
11371137
.apply_compression_config(
11381138
accept_compression_encodings,
@@ -1178,7 +1178,7 @@ pub mod bee_remote_server {
11781178
let inner = self.inner.clone();
11791179
let fut = async move {
11801180
let method = GetJobsSvc(inner);
1181-
let codec = tonic::codec::ProstCodec::default();
1181+
let codec = tonic_prost::ProstCodec::default();
11821182
let mut grpc = tonic::server::Grpc::new(codec)
11831183
.apply_compression_config(
11841184
accept_compression_encodings,
@@ -1223,7 +1223,7 @@ pub mod bee_remote_server {
12231223
let inner = self.inner.clone();
12241224
let fut = async move {
12251225
let method = UpdateWorkSvc(inner);
1226-
let codec = tonic::codec::ProstCodec::default();
1226+
let codec = tonic_prost::ProstCodec::default();
12271227
let mut grpc = tonic::server::Grpc::new(codec)
12281228
.apply_compression_config(
12291229
accept_compression_encodings,
@@ -1268,7 +1268,7 @@ pub mod bee_remote_server {
12681268
let inner = self.inner.clone();
12691269
let fut = async move {
12701270
let method = GetRSTConfigSvc(inner);
1271-
let codec = tonic::codec::ProstCodec::default();
1271+
let codec = tonic_prost::ProstCodec::default();
12721272
let mut grpc = tonic::server::Grpc::new(codec)
12731273
.apply_compression_config(
12741274
accept_compression_encodings,
@@ -1313,7 +1313,7 @@ pub mod bee_remote_server {
13131313
let inner = self.inner.clone();
13141314
let fut = async move {
13151315
let method = GetStubContentsSvc(inner);
1316-
let codec = tonic::codec::ProstCodec::default();
1316+
let codec = tonic_prost::ProstCodec::default();
13171317
let mut grpc = tonic::server::Grpc::new(codec)
13181318
.apply_compression_config(
13191319
accept_compression_encodings,
@@ -1361,7 +1361,7 @@ pub mod bee_remote_server {
13611361
let inner = self.inner.clone();
13621362
let fut = async move {
13631363
let method = GetCapabilitiesSvc(inner);
1364-
let codec = tonic::codec::ProstCodec::default();
1364+
let codec = tonic_prost::ProstCodec::default();
13651365
let mut grpc = tonic::server::Grpc::new(codec)
13661366
.apply_compression_config(
13671367
accept_compression_encodings,

rust/beewatch.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/// API. Those should only affect the serialization format between the meta and watch services, and
55
/// should adhere to standard protocol buffer best practices. Notably minor updates should be
66
/// additive and not remove or change the meaning of existing fields.
7-
#[derive(Clone, PartialEq, ::prost::Message)]
7+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
88
pub struct Event {
99
#[prost(uint64, tag = "1")]
1010
pub seq_id: u64,
@@ -20,7 +20,7 @@ pub struct Event {
2020
}
2121
/// Nested message and enum types in `Event`.
2222
pub mod event {
23-
#[derive(Clone, PartialEq, ::prost::Oneof)]
23+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
2424
pub enum EventData {
2525
#[prost(message, tag = "11")]
2626
V1(super::V1Event),
@@ -29,7 +29,7 @@ pub mod event {
2929
}
3030
}
3131
/// The v1 event format is the legacy format from BeeGFS v7.
32-
#[derive(Clone, PartialEq, ::prost::Message)]
32+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3333
pub struct V1Event {
3434
#[prost(enumeration = "v1_event::Type", tag = "1")]
3535
pub r#type: i32,
@@ -121,7 +121,7 @@ pub mod v1_event {
121121
}
122122
}
123123
/// The v2 event format was introduced in BeeGFS v8.
124-
#[derive(Clone, PartialEq, ::prost::Message)]
124+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
125125
pub struct V2Event {
126126
#[prost(enumeration = "v2_event::Type", tag = "1")]
127127
pub r#type: i32,
@@ -236,7 +236,7 @@ pub mod v2_event {
236236
}
237237
}
238238
/// Response messages allow the subscribers to acknowledge events they have processed and request a graceful shutdown.
239-
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
239+
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
240240
pub struct Response {
241241
#[prost(uint64, tag = "1")]
242242
pub completed_seq: u64,
@@ -349,7 +349,7 @@ pub mod subscriber_client {
349349
format!("Service was not ready: {}", e.into()),
350350
)
351351
})?;
352-
let codec = tonic::codec::ProstCodec::default();
352+
let codec = tonic_prost::ProstCodec::default();
353353
let path = http::uri::PathAndQuery::from_static(
354354
"/beewatch.Subscriber/ReceiveEvents",
355355
);
@@ -492,7 +492,7 @@ pub mod subscriber_server {
492492
let inner = self.inner.clone();
493493
let fut = async move {
494494
let method = ReceiveEventsSvc(inner);
495-
let codec = tonic::codec::ProstCodec::default();
495+
let codec = tonic_prost::ProstCodec::default();
496496
let mut grpc = tonic::server::Grpc::new(codec)
497497
.apply_compression_config(
498498
accept_compression_encodings,

0 commit comments

Comments
 (0)