Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
rekby authored Oct 31, 2024
2 parents 0742c6e + 1c32018 commit 26b98ec
Show file tree
Hide file tree
Showing 24 changed files with 1,214 additions and 65 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-crate.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Publish rust crate to crates.io
env:
CARGO_TERM_COLOR: always
RUST_VERSION: 1.79.0
RUST_VERSION: 1.81.0
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse

on:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/rust-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:
CARGO_TERM_COLOR: always
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
RUST_VERSION_OLD: "1.60.0"
RUST_VERSION_NEW: "1.79.0"
RUST_VERSION_NEW: "1.81.0"

jobs:
tests:
Expand Down Expand Up @@ -65,6 +65,6 @@ jobs:
run: cargo test --verbose --workspace -- --include-ignored

- name: Linter
if: matrix.rust_version == 'NEW'
if: matrix.rust_version == 'RUST_VERSION_NEW'
run: |
cargo clippy --workspace --all-targets -- -D warnings
cargo clippy --workspace --all-targets --no-deps --exclude=ydb-grpc -- -D warnings
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ydb-example-urlshortener/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ tokio = { version = "1.18", features = ["macros", "rt-multi-thread", "net"] }
tracing = "0.1"
tracing-subscriber = "0.3"
warp = "0.3.2"
ydb = { version = "0.9.2", path="../ydb"}
ydb = { version = "0.9.3", path="../ydb"}
2 changes: 1 addition & 1 deletion ydb-grpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
publish = true
name = "ydb-grpc"
version = "0.0.14"
version = "0.1.0"
authors = ["rekby <timofey.koolin@gmail.com>"]
edition = "2021"
license = "Apache-2.0"
Expand Down
Binary file modified ydb-grpc/src/descriptors.bin
Binary file not shown.
151 changes: 114 additions & 37 deletions ydb-grpc/src/generated/google.protobuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ pub struct FileDescriptorProto {
/// If `edition` is present, this value must be "editions".
#[prost(string, optional, tag = "12")]
pub syntax: ::core::option::Option<::prost::alloc::string::String>,
/// The edition of the proto file, which is an opaque string.
#[prost(string, optional, tag = "13")]
pub edition: ::core::option::Option<::prost::alloc::string::String>,
/// The edition of the proto file.
#[prost(enumeration = "Edition", optional, tag = "14")]
pub edition: ::core::option::Option<i32>,
}
/// Describes a message type.
#[derive(Clone, PartialEq, ::prost::Message)]
Expand Down Expand Up @@ -281,7 +281,7 @@ pub struct ExtensionRangeOptions {
#[prost(message, optional, tag = "50")]
pub features: ::core::option::Option<FeatureSet>,
/// The verification state of the range.
/// TODO(b/278783756): flip the default to DECLARATION once all empty ranges
/// TODO: flip the default to DECLARATION once all empty ranges
/// are marked as UNVERIFIED.
#[prost(
enumeration = "extension_range_options::VerificationState",
Expand Down Expand Up @@ -441,9 +441,10 @@ pub mod field_descriptor_proto {
Bool = 8,
String = 9,
/// Tag-delimited aggregate.
/// Group type is deprecated and not supported in proto3. However, Proto3
/// Group type is deprecated and not supported after google.protobuf. However, Proto3
/// implementations should still be able to parse the group wire format and
/// treat group fields as unknown fields.
/// treat group fields as unknown fields. In Editions, the group wire format
/// can be enabled via the `message_encoding` feature.
Group = 10,
/// Length-delimited aggregate.
Message = 11,
Expand Down Expand Up @@ -500,8 +501,11 @@ pub mod field_descriptor_proto {
pub enum Label {
/// 0 is reserved for errors
Optional = 1,
Required = 2,
Repeated = 3,
/// The required label is only allowed in google.protobuf. In proto3 and Editions
/// it's explicitly prohibited. In Editions, the `field_presence` feature
/// can be used to get this behavior.
Required = 2,
}
impl Label {
/// String value of the enum field names used in the ProtoBuf definition.
Expand All @@ -510,8 +514,8 @@ pub mod field_descriptor_proto {
pub fn as_str_name(&self) -> &'static str {
match self {
Label::Optional => "LABEL_OPTIONAL",
Label::Required => "LABEL_REQUIRED",
Label::Repeated => "LABEL_REPEATED",
Label::Required => "LABEL_REQUIRED",
}
}
}
Expand Down Expand Up @@ -811,7 +815,7 @@ pub struct MessageOptions {
/// well.
/// This should only be used as a temporary measure against broken builds due
/// to the change in behavior for JSON field name conflicts.
/// TODO(b/261750190) This is legacy behavior we plan to remove once downstream
/// TODO This is legacy behavior we plan to remove once downstream
/// teams have had time to migrate.
#[deprecated]
#[prost(bool, optional, tag = "11")]
Expand Down Expand Up @@ -842,7 +846,9 @@ pub struct FieldOptions {
/// a more efficient representation on the wire. Rather than repeatedly
/// writing the tag and type for each element, the entire array is encoded as
/// a single length-delimited blob. In proto3, only explicit setting it to
/// false will avoid using packed encoding.
/// false will avoid using packed encoding. This option is prohibited in
/// Editions, but the `repeated_field_encoding` feature can be used to control
/// the behavior.
#[prost(bool, optional, tag = "2")]
pub packed: ::core::option::Option<bool>,
/// The jstype option determines the JavaScript type used for values of the
Expand Down Expand Up @@ -930,8 +936,8 @@ pub struct FieldOptions {
pub mod field_options {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EditionDefault {
#[prost(string, optional, tag = "1")]
pub edition: ::core::option::Option<::prost::alloc::string::String>,
#[prost(enumeration = "super::Edition", optional, tag = "3")]
pub edition: ::core::option::Option<i32>,
/// Textproto value.
#[prost(string, optional, tag = "2")]
pub value: ::core::option::Option<::prost::alloc::string::String>,
Expand Down Expand Up @@ -1111,7 +1117,7 @@ pub struct EnumOptions {
/// and strips underscored from the fields before comparison in proto3 only.
/// The new behavior takes `json_name` into account and applies to proto2 as
/// well.
/// TODO(b/261750190) Remove this legacy behavior once downstream teams have
/// TODO Remove this legacy behavior once downstream teams have
/// had time to migrate.
#[deprecated]
#[prost(bool, optional, tag = "6")]
Expand Down Expand Up @@ -1257,7 +1263,7 @@ pub mod uninterpreted_option {
pub is_extension: bool,
}
}
/// TODO(b/274655146) Enums in C++ gencode (and potentially other languages) are
/// TODO Enums in C++ gencode (and potentially other languages) are
/// not well scoped. This means that each of the feature enums below can clash
/// with each other. The short names we've chosen maximize call-site
/// readability, but leave us very open to this scenario. A future feature will
Expand All @@ -1271,14 +1277,12 @@ pub struct FeatureSet {
pub enum_type: ::core::option::Option<i32>,
#[prost(enumeration = "feature_set::RepeatedFieldEncoding", optional, tag = "3")]
pub repeated_field_encoding: ::core::option::Option<i32>,
#[prost(enumeration = "feature_set::StringFieldValidation", optional, tag = "4")]
pub string_field_validation: ::core::option::Option<i32>,
#[prost(enumeration = "feature_set::Utf8Validation", optional, tag = "4")]
pub utf8_validation: ::core::option::Option<i32>,
#[prost(enumeration = "feature_set::MessageEncoding", optional, tag = "5")]
pub message_encoding: ::core::option::Option<i32>,
#[prost(enumeration = "feature_set::JsonFormat", optional, tag = "6")]
pub json_format: ::core::option::Option<i32>,
#[prost(message, optional, boxed, tag = "999")]
pub raw_features: ::core::option::Option<::prost::alloc::boxed::Box<FeatureSet>>,
}
/// Nested message and enum types in `FeatureSet`.
pub mod feature_set {
Expand Down Expand Up @@ -1383,22 +1387,20 @@ pub mod feature_set {
::prost::Enumeration
)]
#[repr(i32)]
pub enum StringFieldValidation {
pub enum Utf8Validation {
Unknown = 0,
Mandatory = 1,
Hint = 2,
None = 3,
None = 1,
Verify = 2,
}
impl StringFieldValidation {
impl Utf8Validation {
/// String value of the enum field names used in the ProtoBuf definition.
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
StringFieldValidation::Unknown => "STRING_FIELD_VALIDATION_UNKNOWN",
StringFieldValidation::Mandatory => "MANDATORY",
StringFieldValidation::Hint => "HINT",
StringFieldValidation::None => "NONE",
Utf8Validation::Unknown => "UTF8_VALIDATION_UNKNOWN",
Utf8Validation::None => "NONE",
Utf8Validation::Verify => "VERIFY",
}
}
}
Expand Down Expand Up @@ -1461,6 +1463,39 @@ pub mod feature_set {
}
}
}
/// A compiled specification for the defaults of a set of features. These
/// messages are generated from FeatureSet extensions and can be used to seed
/// feature resolution. The resolution with this object becomes a simple search
/// for the closest matching edition, followed by proto merges.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FeatureSetDefaults {
#[prost(message, repeated, tag = "1")]
pub defaults: ::prost::alloc::vec::Vec<
feature_set_defaults::FeatureSetEditionDefault,
>,
/// The minimum supported edition (inclusive) when this was constructed.
/// Editions before this will not have defaults.
#[prost(enumeration = "Edition", optional, tag = "4")]
pub minimum_edition: ::core::option::Option<i32>,
/// The maximum known edition (inclusive) when this was constructed. Editions
/// after this will not have reliable defaults.
#[prost(enumeration = "Edition", optional, tag = "5")]
pub maximum_edition: ::core::option::Option<i32>,
}
/// Nested message and enum types in `FeatureSetDefaults`.
pub mod feature_set_defaults {
/// A map from every known edition with a unique set of defaults to its
/// defaults. Not all editions may be contained here. For a given edition,
/// the defaults at the closest matching edition ordered at or before it should
/// be used. This field must be in strict ascending order by edition.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FeatureSetEditionDefault {
#[prost(enumeration = "super::Edition", optional, tag = "3")]
pub edition: ::core::option::Option<i32>,
#[prost(message, optional, tag = "2")]
pub features: ::core::option::Option<super::FeatureSet>,
}
}
/// Encapsulates information about the original source file from which a
/// FileDescriptorProto was generated.
#[derive(Clone, PartialEq, ::prost::Message)]
Expand Down Expand Up @@ -1660,6 +1695,48 @@ pub mod generated_code_info {
}
}
}
/// The full set of known editions.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Edition {
/// A placeholder for an unknown edition value.
Unknown = 0,
/// Legacy syntax "editions". These pre-date editions, but behave much like
/// distinct editions. These can't be used to specify the edition of proto
/// files, but feature definitions must supply proto2/proto3 defaults for
/// backwards compatibility.
Proto2 = 998,
Proto3 = 999,
/// Editions that have been released. The specific values are arbitrary and
/// should not be depended on, but they will always be time-ordered for easy
/// comparison.
Edition2023 = 1000,
/// Placeholder editions for testing feature resolution. These should not be
/// used or relyed on outside of tests.
Edition1TestOnly = 1,
Edition2TestOnly = 2,
Edition99997TestOnly = 99997,
Edition99998TestOnly = 99998,
Edition99999TestOnly = 99999,
}
impl Edition {
/// String value of the enum field names used in the ProtoBuf definition.
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Edition::Unknown => "EDITION_UNKNOWN",
Edition::Proto2 => "EDITION_PROTO2",
Edition::Proto3 => "EDITION_PROTO3",
Edition::Edition2023 => "EDITION_2023",
Edition::Edition1TestOnly => "EDITION_1_TEST_ONLY",
Edition::Edition2TestOnly => "EDITION_2_TEST_ONLY",
Edition::Edition99997TestOnly => "EDITION_99997_TEST_ONLY",
Edition::Edition99998TestOnly => "EDITION_99998_TEST_ONLY",
Edition::Edition99999TestOnly => "EDITION_99999_TEST_ONLY",
}
}
}
/// `Struct` represents a structured data value, consisting of fields
/// which map to dynamically typed values. In some languages, `Struct`
/// might be supported by a native representation. For example, in
Expand Down Expand Up @@ -1736,15 +1813,6 @@ impl NullValue {
}
}
}
/// A generic empty message that you can re-use to avoid defining duplicated
/// empty messages in your APIs. A typical example is to use it as the request
/// or the response type of an API method. For instance:
/// service Foo {
/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
/// }
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Empty {}
/// A Timestamp represents a point in time independent of any time zone or local
/// calendar, encoded as a count of seconds and fractions of seconds at
/// nanosecond resolution. The count is relative to an epoch at UTC midnight on
Expand Down Expand Up @@ -1825,4 +1893,13 @@ pub struct Timestamp {
/// inclusive.
#[prost(int32, tag = "2")]
pub nanos: i32,
}
}
/// A generic empty message that you can re-use to avoid defining duplicated
/// empty messages in your APIs. A typical example is to use it as the request
/// or the response type of an API method. For instance:
/// service Foo {
/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
/// }
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Empty {}
29 changes: 29 additions & 0 deletions ydb-grpc/src/generated/ydb.discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,33 @@ pub struct WhoAmIResult {
pub struct WhoAmIResponse {
#[prost(message, optional, tag = "1")]
pub operation: ::core::option::Option<super::operations::Operation>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NodeLocation {
/// compatibility section -- will be removed in future versions
#[deprecated]
#[prost(uint32, optional, tag = "1")]
pub data_center_num: ::core::option::Option<u32>,
#[deprecated]
#[prost(uint32, optional, tag = "2")]
pub room_num: ::core::option::Option<u32>,
#[deprecated]
#[prost(uint32, optional, tag = "3")]
pub rack_num: ::core::option::Option<u32>,
#[deprecated]
#[prost(uint32, optional, tag = "4")]
pub body_num: ::core::option::Option<u32>,
/// for compatibility with WalleLocation
#[deprecated]
#[prost(uint32, optional, tag = "100500")]
pub body: ::core::option::Option<u32>,
#[prost(string, optional, tag = "10")]
pub data_center: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "20")]
pub module: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "30")]
pub rack: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "40")]
pub unit: ::core::option::Option<::prost::alloc::string::String>,
}
Loading

0 comments on commit 26b98ec

Please sign in to comment.