Skip to content

Commit ecdf4dc

Browse files
authored
Merge pull request #49 from ThinkParQ/rb/pin-rust-deps
Fix rust deps to 0.13, update protoc-rs to 0.5.0
2 parents f44f100 + 2c2e9e2 commit ecdf4dc

9 files changed

Lines changed: 366 additions & 500 deletions

File tree

.github/workflows/checks.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ jobs:
3131
- name: Install tools
3232
if: steps.cache.outputs.cache-hit != 'true'
3333
run: |
34-
git config --global url."https://${{ secrets.CI_PROTOBUF_ACCESS }}@github.com/thinkparq/protoc-rs".insteadOf https://github.com/thinkparq/protoc-rs
3534
make install-tools
3635
- run: echo "${HOME}/.local/bin" >> $GITHUB_PATH
3736
- name: Check diff

Cargo.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "protobuf"
3-
version = "0.1.0"
3+
version = "0.0.0"
44
edition = "2021"
55

66
authors = ["ThinkparQ Development Team <development@thinkparq.com>"]
@@ -10,9 +10,11 @@ homepage = "https://github.com/thinkparq/protobuf"
1010
publish = false
1111

1212
[dependencies]
13-
tonic = "~0"
14-
prost = "~0"
15-
prost-types = "~0"
13+
# The version requirements of these must match the version requirement of protoc-rs used to
14+
# generate the code
15+
tonic = "0.13"
16+
prost = "0.13"
17+
prost-types = "0.13"
1618

1719
[lib]
1820
path = "rust/lib.rs"

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ protos: check-tools
2323
--go-grpc_out=$(GO_OUT_DIR) \
2424
--cpp_out=$(CPP_OUT_DIR) \
2525
$(SRC_DIR)/*.proto
26-
protoc-rs compile -I $(SRC_DIR) --out=$(RUST_OUT_DIR) $(SRC_DIR)/*.proto
26+
protoc-rs -I $(SRC_DIR) --out=$(RUST_OUT_DIR) $(SRC_DIR)/*.proto
2727

2828

2929
# Test targets:
@@ -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.3.0
60+
PROTOC_RS_VERSION := 0.5.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: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +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-
#[allow(clippy::derive_partial_eq_without_eq)]
6-
#[derive(Clone, PartialEq, ::prost::Message)]
5+
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
76
pub struct LegacyId {
87
/// BeeGFS numeric id.
98
/// Required, 0 is invalid.
@@ -23,7 +22,6 @@ pub struct LegacyId {
2322
/// 2) In a response message (from the management), _all_ fields should be set. The request processor
2423
/// should have all info about an entity available. If that isn't the case, leaving fields empty is
2524
/// allowed.
26-
#[allow(clippy::derive_partial_eq_without_eq)]
2725
#[derive(Clone, PartialEq, ::prost::Message)]
2826
pub struct EntityIdSet {
2927
/// The global, unique entity id. Identifies an entity from all types without any additional
@@ -59,11 +57,11 @@ impl EntityType {
5957
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
6058
pub fn as_str_name(&self) -> &'static str {
6159
match self {
62-
EntityType::Unspecified => "ENTITY_TYPE_UNSPECIFIED",
63-
EntityType::Node => "NODE",
64-
EntityType::Target => "TARGET",
65-
EntityType::BuddyGroup => "BUDDY_GROUP",
66-
EntityType::Pool => "POOL",
60+
Self::Unspecified => "ENTITY_TYPE_UNSPECIFIED",
61+
Self::Node => "NODE",
62+
Self::Target => "TARGET",
63+
Self::BuddyGroup => "BUDDY_GROUP",
64+
Self::Pool => "POOL",
6765
}
6866
}
6967
/// Creates an enum from field names used in the ProtoBuf definition.
@@ -94,11 +92,11 @@ impl NodeType {
9492
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
9593
pub fn as_str_name(&self) -> &'static str {
9694
match self {
97-
NodeType::Unspecified => "NODE_TYPE_UNSPECIFIED",
98-
NodeType::Client => "CLIENT",
99-
NodeType::Meta => "META",
100-
NodeType::Storage => "STORAGE",
101-
NodeType::Management => "MANAGEMENT",
95+
Self::Unspecified => "NODE_TYPE_UNSPECIFIED",
96+
Self::Client => "CLIENT",
97+
Self::Meta => "META",
98+
Self::Storage => "STORAGE",
99+
Self::Management => "MANAGEMENT",
102100
}
103101
}
104102
/// Creates an enum from field names used in the ProtoBuf definition.
@@ -128,10 +126,10 @@ impl ReachabilityState {
128126
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
129127
pub fn as_str_name(&self) -> &'static str {
130128
match self {
131-
ReachabilityState::Unspecified => "REACHABILITY_STATE_UNSPECIFIED",
132-
ReachabilityState::Online => "ONLINE",
133-
ReachabilityState::Poffline => "POFFLINE",
134-
ReachabilityState::Offline => "OFFLINE",
129+
Self::Unspecified => "REACHABILITY_STATE_UNSPECIFIED",
130+
Self::Online => "ONLINE",
131+
Self::Poffline => "POFFLINE",
132+
Self::Offline => "OFFLINE",
135133
}
136134
}
137135
/// Creates an enum from field names used in the ProtoBuf definition.
@@ -160,10 +158,10 @@ impl ConsistencyState {
160158
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
161159
pub fn as_str_name(&self) -> &'static str {
162160
match self {
163-
ConsistencyState::Unspecified => "CONSISTENCY_STATE_UNSPECIFIED",
164-
ConsistencyState::Good => "GOOD",
165-
ConsistencyState::NeedsResync => "NEEDS_RESYNC",
166-
ConsistencyState::Bad => "BAD",
161+
Self::Unspecified => "CONSISTENCY_STATE_UNSPECIFIED",
162+
Self::Good => "GOOD",
163+
Self::NeedsResync => "NEEDS_RESYNC",
164+
Self::Bad => "BAD",
167165
}
168166
}
169167
/// Creates an enum from field names used in the ProtoBuf definition.
@@ -192,10 +190,10 @@ impl CapacityPool {
192190
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
193191
pub fn as_str_name(&self) -> &'static str {
194192
match self {
195-
CapacityPool::Unspecified => "CAPACITY_POOL_UNSPECIFIED",
196-
CapacityPool::Normal => "NORMAL",
197-
CapacityPool::Low => "LOW",
198-
CapacityPool::Emergency => "EMERGENCY",
193+
Self::Unspecified => "CAPACITY_POOL_UNSPECIFIED",
194+
Self::Normal => "NORMAL",
195+
Self::Low => "LOW",
196+
Self::Emergency => "EMERGENCY",
199197
}
200198
}
201199
/// Creates an enum from field names used in the ProtoBuf definition.
@@ -223,9 +221,9 @@ impl NicType {
223221
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
224222
pub fn as_str_name(&self) -> &'static str {
225223
match self {
226-
NicType::Unspecified => "NIC_TYPE_UNSPECIFIED",
227-
NicType::Ethernet => "ETHERNET",
228-
NicType::Rdma => "RDMA",
224+
Self::Unspecified => "NIC_TYPE_UNSPECIFIED",
225+
Self::Ethernet => "ETHERNET",
226+
Self::Rdma => "RDMA",
229227
}
230228
}
231229
/// Creates an enum from field names used in the ProtoBuf definition.
@@ -252,9 +250,9 @@ impl QuotaIdType {
252250
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
253251
pub fn as_str_name(&self) -> &'static str {
254252
match self {
255-
QuotaIdType::Unspecified => "QUOTA_ID_TYPE_UNSPECIFIED",
256-
QuotaIdType::User => "QUOTA_ID_TYPE_USER",
257-
QuotaIdType::Group => "QUOTA_ID_TYPE_GROUP",
253+
Self::Unspecified => "QUOTA_ID_TYPE_UNSPECIFIED",
254+
Self::User => "QUOTA_ID_TYPE_USER",
255+
Self::Group => "QUOTA_ID_TYPE_GROUP",
258256
}
259257
}
260258
/// Creates an enum from field names used in the ProtoBuf definition.
@@ -281,9 +279,9 @@ impl QuotaType {
281279
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
282280
pub fn as_str_name(&self) -> &'static str {
283281
match self {
284-
QuotaType::Unspecified => "QUOTA_TYPE_UNSPECIFIED",
285-
QuotaType::Space => "QUOTA_TYPE_SPACE",
286-
QuotaType::Inode => "QUOTA_TYPE_INODE",
282+
Self::Unspecified => "QUOTA_TYPE_UNSPECIFIED",
283+
Self::Space => "QUOTA_TYPE_SPACE",
284+
Self::Inode => "QUOTA_TYPE_INODE",
287285
}
288286
}
289287
/// Creates an enum from field names used in the ProtoBuf definition.

0 commit comments

Comments
 (0)