From cc8ae0a63194c3e375ad1375e5ee798c05cc5a40 Mon Sep 17 00:00:00 2001 From: Yo Eight Date: Tue, 24 Dec 2024 08:50:22 -0500 Subject: [PATCH] Upgrade to latest plus QoL improvements. (#186) --- .github/workflows/tests.yml | 6 +- eventstore/Cargo.toml | 33 ++- eventstore/codegen.rs | 12 +- eventstore/src/client.rs | 2 +- eventstore/src/commands.rs | 2 +- .../src/event_store/generated/common.rs | 36 +--- .../src/event_store/generated/google_rpc.rs | 36 ++-- .../src/event_store/generated/gossip.rs | 55 ++--- .../src/event_store/generated/monitoring.rs | 24 ++- .../src/event_store/generated/operations.rs | 68 +++---- .../src/event_store/generated/persistent.rs | 187 +++++------------ .../src/event_store/generated/projections.rs | 112 +++------- .../event_store/generated/server_features.rs | 22 +- .../src/event_store/generated/streams.rs | 191 ++++++------------ eventstore/src/event_store/generated/users.rs | 97 +++------ eventstore/src/grpc.rs | 83 ++++++-- eventstore/src/request.rs | 4 +- eventstore/src/types.rs | 40 ++-- eventstore/tests/api/streams.rs | 2 +- eventstore/tests/common.rs | 2 +- examples/appending_events.rs | 4 +- examples/quickstart.rs | 2 +- 22 files changed, 390 insertions(+), 630 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 938c50fe..27a81ae7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -69,7 +69,7 @@ jobs: run: rustup update stable - name: Generate certificates - run: docker-compose --file configure-tls-for-tests.yml up + run: docker compose --file configure-tls-for-tests.yml up - name: Run test run: cargo test --package eventstore --test integration single_node_${{ matrix.test }} @@ -104,7 +104,7 @@ jobs: run: rustup update stable - name: Set up cluster with Docker Compose - run: docker-compose up -d + run: docker compose up -d env: ESDB_DOCKER_REPO: ${{ needs.provide_docker.outputs.docker_repo }} ESDB_DOCKER_CONTAINER: ${{ needs.provide_docker.outputs.docker_container }} @@ -118,4 +118,4 @@ jobs: RUST_BACKTRACE: 1 - name: Shutdown cluster - run: docker-compose down + run: docker compose down diff --git a/eventstore/Cargo.toml b/eventstore/Cargo.toml index bdf520ca..1be6b18d 100755 --- a/eventstore/Cargo.toml +++ b/eventstore/Cargo.toml @@ -19,43 +19,42 @@ categories = ["database", "api-bindings"] [dependencies] async-stream = "0.3" -base64 = "0.13" +base64 = "0.22" bitflags = "2" -byteorder = "1.2" +byteorder = "1" bytes = "1" chrono = { version = "0.4", default-features = false, features = ["std", "serde"] } eventstore-macros = { path = "../eventstore-macros", version = "0.0.1" } futures = "0.3" -http = "0.2" -hyper = { version = "0.14", features = ["client", "tcp"] } -hyper-rustls = { version = "0.23", features = ["rustls-native-certs", "http2"] } +http = "1" +hyper = { version = "1", features = ["client"] } +hyper-util = { version = "0.1", features = ["client-legacy", "http2"] } +hyper-rustls = { version = "0.27", features = ["rustls-native-certs", "http2"] } log = "0.4" nom = "7" -prost = "0.12" -prost-derive = "0.12" -prost-types = "0.12" +prost = "0.13" +prost-types = "0.13" rand = { version = "0.8", features = ["small_rng"] } -reqwest = { version = "0.11", default-features = false, features = [ +reqwest = { version = "0.12", default-features = false, features = [ "rustls-tls", "rustls-tls-native-roots", "json", ] } -rustls = { version = "0.20", features = ["dangerous_configuration"] } -rustls-native-certs = "0.6" +rustls = { version = "0.23" } +rustls-native-certs = "0.8" serde = { version = "1", features = ["derive"] } serde_json = "1" -thiserror = "1" +thiserror = "2" tokio = { version = "1", default-features = false, features = ["time"] } -tokio-rustls = "0.23" -tonic = { version = "0.10", features = ["tls", "tls-roots"] } -tower = "0.4" +tokio-rustls = "0.26" +tonic = { version = "0.12", features = ["tls", "tls-roots"] } +tower = "0.5" url = "2" urlencoding = "2" uuid = { version = "1", features = ["v4", "serde"] } -webpki = "0.22" [build-dependencies] -tonic-build = { version = "0.10.2", features = ["prost-build"] } +tonic-build = { version = "0.12", features = ["prost-build"] } [[test]] name = "integration" diff --git a/eventstore/codegen.rs b/eventstore/codegen.rs index 172da5fa..56c30b71 100755 --- a/eventstore/codegen.rs +++ b/eventstore/codegen.rs @@ -12,7 +12,7 @@ pub fn generate() -> Result<(), Box> { .extern_path(".event_store.client.Empty", "()") .bytes(&["StreamIdentifier.stream_name"]) .out_dir(out_dir) - .compile(&files, &[""])?; + .compile_protos(&files, &[""])?; for entry in std::fs::read_dir(out_dir)? { let file = entry.unwrap(); @@ -25,7 +25,7 @@ pub fn generate() -> Result<(), Box> { let new_file = file.path().parent().unwrap().join("common.rs"); - std::fs::rename(file.path(), new_file)?; + fs::rename(file.path(), new_file)?; } } @@ -40,7 +40,7 @@ pub fn generate() -> Result<(), Box> { "protos/users.proto", ]; - std::fs::create_dir_all(out_dir)?; + fs::create_dir_all(out_dir)?; tonic_build::configure() .build_server(false) @@ -67,7 +67,7 @@ pub fn generate() -> Result<(), Box> { ".event_store.client.UUID", "crate::event_store::generated::common::Uuid", ) - .compile(&files, &["protos"])?; + .compile_protos(&files, &["protos"])?; for entry in std::fs::read_dir(out_dir)? { let file = entry.unwrap(); @@ -87,10 +87,10 @@ pub fn generate() -> Result<(), Box> { let new_file = file.path().parent().unwrap().join(new_file_name); - std::fs::rename(file.path(), new_file)?; + fs::rename(file.path(), new_file)?; } else if filename_string.as_str() == "google.rpc.rs" { let new_file = file.path().parent().unwrap().join("google_rpc.rs"); - std::fs::rename(file.path(), new_file)?; + fs::rename(file.path(), new_file)?; } } diff --git a/eventstore/src/client.rs b/eventstore/src/client.rs index 8bee1ea3..e3ca119d 100644 --- a/eventstore/src/client.rs +++ b/eventstore/src/client.rs @@ -86,7 +86,7 @@ impl Client { &self, name: impl MetadataStreamName, options: &AppendToStreamOptions, - metadata: StreamMetadata, + metadata: &StreamMetadata, ) -> crate::Result { let event = EventData::json("$metadata", metadata) .map_err(|e| crate::Error::InternalParsingError(e.to_string()))?; diff --git a/eventstore/src/commands.rs b/eventstore/src/commands.rs index b32bd319..94219cf8 100644 --- a/eventstore/src/commands.rs +++ b/eventstore/src/commands.rs @@ -151,7 +151,7 @@ pub async fn append_to_stream( }); let header = Content::Options(append_req::Options { stream_identifier, - expected_stream_revision: Some(options.version.clone()), + expected_stream_revision: Some(options.version), }); let header = AppendReq { content: Some(header), diff --git a/eventstore/src/event_store/generated/common.rs b/eventstore/src/event_store/generated/common.rs index c7d21c6d..ee9b2398 100644 --- a/eventstore/src/event_store/generated/common.rs +++ b/eventstore/src/event_store/generated/common.rs @@ -1,4 +1,4 @@ -#[allow(clippy::derive_partial_eq_without_eq)] +// This file is @generated by prost-build. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Uuid { #[prost(oneof = "uuid::Value", tags = "1, 2")] @@ -6,15 +6,13 @@ pub struct Uuid { } /// Nested message and enum types in `UUID`. pub mod uuid { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Structured { #[prost(int64, tag = "1")] pub most_significant_bits: i64, #[prost(int64, tag = "2")] pub least_significant_bits: i64, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Value { #[prost(message, tag = "1")] @@ -23,22 +21,19 @@ pub mod uuid { String(::prost::alloc::string::String), } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StreamIdentifier { #[prost(bytes = "bytes", tag = "3")] pub stream_name: ::prost::bytes::Bytes, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct AllStreamPosition { #[prost(uint64, tag = "1")] pub commit_position: u64, #[prost(uint64, tag = "2")] pub prepare_position: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct WrongExpectedVersion { #[prost( oneof = "wrong_expected_version::CurrentStreamRevisionOption", @@ -55,16 +50,14 @@ pub struct WrongExpectedVersion { } /// Nested message and enum types in `WrongExpectedVersion`. pub mod wrong_expected_version { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum CurrentStreamRevisionOption { #[prost(uint64, tag = "1")] CurrentStreamRevision(u64), #[prost(message, tag = "2")] CurrentNoStream(()), } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum ExpectedStreamPositionOption { #[prost(uint64, tag = "3")] ExpectedStreamPosition(u64), @@ -76,31 +69,24 @@ pub mod wrong_expected_version { ExpectedNoStream(()), } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct AccessDenied {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StreamDeleted { #[prost(message, optional, tag = "1")] pub stream_identifier: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Timeout {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Unknown {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct InvalidTransaction {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MaximumAppendSizeExceeded { #[prost(uint32, tag = "1")] pub max_append_size: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BadRequest { #[prost(string, tag = "1")] diff --git a/eventstore/src/event_store/generated/google_rpc.rs b/eventstore/src/event_store/generated/google_rpc.rs index ba90c3ed..0e82ddfe 100644 --- a/eventstore/src/event_store/generated/google_rpc.rs +++ b/eventstore/src/event_store/generated/google_rpc.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. /// The canonical error codes for gRPC APIs. /// /// @@ -153,23 +154,23 @@ impl Code { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Code::Ok => "OK", - Code::Cancelled => "CANCELLED", - Code::Unknown => "UNKNOWN", - Code::InvalidArgument => "INVALID_ARGUMENT", - Code::DeadlineExceeded => "DEADLINE_EXCEEDED", - Code::NotFound => "NOT_FOUND", - Code::AlreadyExists => "ALREADY_EXISTS", - Code::PermissionDenied => "PERMISSION_DENIED", - Code::Unauthenticated => "UNAUTHENTICATED", - Code::ResourceExhausted => "RESOURCE_EXHAUSTED", - Code::FailedPrecondition => "FAILED_PRECONDITION", - Code::Aborted => "ABORTED", - Code::OutOfRange => "OUT_OF_RANGE", - Code::Unimplemented => "UNIMPLEMENTED", - Code::Internal => "INTERNAL", - Code::Unavailable => "UNAVAILABLE", - Code::DataLoss => "DATA_LOSS", + Self::Ok => "OK", + Self::Cancelled => "CANCELLED", + Self::Unknown => "UNKNOWN", + Self::InvalidArgument => "INVALID_ARGUMENT", + Self::DeadlineExceeded => "DEADLINE_EXCEEDED", + Self::NotFound => "NOT_FOUND", + Self::AlreadyExists => "ALREADY_EXISTS", + Self::PermissionDenied => "PERMISSION_DENIED", + Self::Unauthenticated => "UNAUTHENTICATED", + Self::ResourceExhausted => "RESOURCE_EXHAUSTED", + Self::FailedPrecondition => "FAILED_PRECONDITION", + Self::Aborted => "ABORTED", + Self::OutOfRange => "OUT_OF_RANGE", + Self::Unimplemented => "UNIMPLEMENTED", + Self::Internal => "INTERNAL", + Self::Unavailable => "UNAVAILABLE", + Self::DataLoss => "DATA_LOSS", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -203,7 +204,6 @@ impl Code { /// /// You can find out more about this error model and how to work with it in the /// [API Design Guide](). -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Status { /// The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. diff --git a/eventstore/src/event_store/generated/gossip.rs b/eventstore/src/event_store/generated/gossip.rs index 23d04254..29cb3386 100644 --- a/eventstore/src/event_store/generated/gossip.rs +++ b/eventstore/src/event_store/generated/gossip.rs @@ -1,10 +1,9 @@ -#[allow(clippy::derive_partial_eq_without_eq)] +// This file is @generated by prost-build. #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClusterInfo { #[prost(message, repeated, tag = "1")] pub members: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EndPoint { #[prost(string, tag = "1")] @@ -12,7 +11,6 @@ pub struct EndPoint { #[prost(uint32, tag = "2")] pub port: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MemberInfo { #[prost(message, optional, tag = "1")] @@ -55,22 +53,22 @@ pub mod member_info { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - VNodeState::Initializing => "Initializing", - VNodeState::DiscoverLeader => "DiscoverLeader", - VNodeState::Unknown => "Unknown", - VNodeState::PreReplica => "PreReplica", - VNodeState::CatchingUp => "CatchingUp", - VNodeState::Clone => "Clone", - VNodeState::Follower => "Follower", - VNodeState::PreLeader => "PreLeader", - VNodeState::Leader => "Leader", - VNodeState::Manager => "Manager", - VNodeState::ShuttingDown => "ShuttingDown", - VNodeState::Shutdown => "Shutdown", - VNodeState::ReadOnlyLeaderless => "ReadOnlyLeaderless", - VNodeState::PreReadOnlyReplica => "PreReadOnlyReplica", - VNodeState::ReadOnlyReplica => "ReadOnlyReplica", - VNodeState::ResigningLeader => "ResigningLeader", + Self::Initializing => "Initializing", + Self::DiscoverLeader => "DiscoverLeader", + Self::Unknown => "Unknown", + Self::PreReplica => "PreReplica", + Self::CatchingUp => "CatchingUp", + Self::Clone => "Clone", + Self::Follower => "Follower", + Self::PreLeader => "PreLeader", + Self::Leader => "Leader", + Self::Manager => "Manager", + Self::ShuttingDown => "ShuttingDown", + Self::Shutdown => "Shutdown", + Self::ReadOnlyLeaderless => "ReadOnlyLeaderless", + Self::PreReadOnlyReplica => "PreReadOnlyReplica", + Self::ReadOnlyReplica => "ReadOnlyReplica", + Self::ResigningLeader => "ResigningLeader", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -99,7 +97,13 @@ pub mod member_info { } /// Generated client implementations. pub mod gossip_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value + )] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -121,8 +125,8 @@ pub mod gossip_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -146,7 +150,7 @@ pub mod gossip_client { >, >, >>::Error: - Into + Send + Sync, + Into + std::marker::Send + std::marker::Sync, { GossipClient::new(InterceptedService::new(inner, interceptor)) } @@ -186,10 +190,7 @@ pub mod gossip_client { request: impl tonic::IntoRequest<()>, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = diff --git a/eventstore/src/event_store/generated/monitoring.rs b/eventstore/src/event_store/generated/monitoring.rs index 86f59a7a..ebb6fd26 100644 --- a/eventstore/src/event_store/generated/monitoring.rs +++ b/eventstore/src/event_store/generated/monitoring.rs @@ -1,12 +1,11 @@ -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +// This file is @generated by prost-build. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct StatsReq { #[prost(bool, tag = "1")] pub use_metadata: bool, #[prost(uint64, tag = "4")] pub refresh_time_period_in_ms: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StatsResp { #[prost(map = "string, string", tag = "1")] @@ -15,7 +14,13 @@ pub struct StatsResp { } /// Generated client implementations. pub mod monitoring_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value + )] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -37,8 +42,8 @@ pub mod monitoring_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -62,7 +67,7 @@ pub mod monitoring_client { >, >, >>::Error: - Into + Send + Sync, + Into + std::marker::Send + std::marker::Sync, { MonitoringClient::new(InterceptedService::new(inner, interceptor)) } @@ -105,10 +110,7 @@ pub mod monitoring_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( diff --git a/eventstore/src/event_store/generated/operations.rs b/eventstore/src/event_store/generated/operations.rs index 7eb13b4a..2c322ad8 100644 --- a/eventstore/src/event_store/generated/operations.rs +++ b/eventstore/src/event_store/generated/operations.rs @@ -1,13 +1,12 @@ -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +// This file is @generated by prost-build. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct StartScavengeReq { #[prost(message, optional, tag = "1")] pub options: ::core::option::Option, } /// Nested message and enum types in `StartScavengeReq`. pub mod start_scavenge_req { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Options { #[prost(int32, tag = "1")] pub thread_count: i32, @@ -15,7 +14,6 @@ pub mod start_scavenge_req { pub start_from_chunk: i32, } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StopScavengeReq { #[prost(message, optional, tag = "1")] @@ -23,14 +21,12 @@ pub struct StopScavengeReq { } /// Nested message and enum types in `StopScavengeReq`. pub mod stop_scavenge_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(string, tag = "1")] pub scavenge_id: ::prost::alloc::string::String, } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ScavengeResp { #[prost(string, tag = "1")] @@ -54,9 +50,9 @@ pub mod scavenge_resp { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ScavengeResult::Started => "Started", - ScavengeResult::InProgress => "InProgress", - ScavengeResult::Stopped => "Stopped", + Self::Started => "Started", + Self::InProgress => "InProgress", + Self::Stopped => "Stopped", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -70,15 +66,20 @@ pub mod scavenge_resp { } } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct SetNodePriorityReq { #[prost(int32, tag = "1")] pub priority: i32, } /// Generated client implementations. pub mod operations_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value + )] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -100,8 +101,8 @@ pub mod operations_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -125,7 +126,7 @@ pub mod operations_client { >, >, >>::Error: - Into + Send + Sync, + Into + std::marker::Send + std::marker::Sync, { OperationsClient::new(InterceptedService::new(inner, interceptor)) } @@ -165,10 +166,7 @@ pub mod operations_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -186,10 +184,7 @@ pub mod operations_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -207,10 +202,7 @@ pub mod operations_client { request: impl tonic::IntoRequest<()>, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -228,10 +220,7 @@ pub mod operations_client { request: impl tonic::IntoRequest<()>, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -249,10 +238,7 @@ pub mod operations_client { request: impl tonic::IntoRequest<()>, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -270,10 +256,7 @@ pub mod operations_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -291,10 +274,7 @@ pub mod operations_client { request: impl tonic::IntoRequest<()>, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( diff --git a/eventstore/src/event_store/generated/persistent.rs b/eventstore/src/event_store/generated/persistent.rs index 981bc8eb..6a8173f4 100644 --- a/eventstore/src/event_store/generated/persistent.rs +++ b/eventstore/src/event_store/generated/persistent.rs @@ -1,4 +1,4 @@ -#[allow(clippy::derive_partial_eq_without_eq)] +// This file is @generated by prost-build. #[derive(Clone, PartialEq, ::prost::Message)] pub struct ReadReq { #[prost(oneof = "read_req::Content", tags = "1, 2, 3")] @@ -6,7 +6,6 @@ pub struct ReadReq { } /// Nested message and enum types in `ReadReq`. pub mod read_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(string, tag = "2")] @@ -20,16 +19,14 @@ pub mod read_req { } /// Nested message and enum types in `Options`. pub mod options { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct UuidOption { #[prost(oneof = "uuid_option::Content", tags = "1, 2")] pub content: ::core::option::Option, } /// Nested message and enum types in `UUIDOption`. pub mod uuid_option { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum Content { #[prost(message, tag = "1")] Structured(()), @@ -37,7 +34,6 @@ pub mod read_req { String(()), } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum StreamOption { #[prost(message, tag = "1")] @@ -46,7 +42,6 @@ pub mod read_req { All(()), } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Ack { #[prost(bytes = "vec", tag = "1")] @@ -54,7 +49,6 @@ pub mod read_req { #[prost(message, repeated, tag = "2")] pub ids: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Nack { #[prost(bytes = "vec", tag = "1")] @@ -86,11 +80,11 @@ pub mod read_req { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Action::Unknown => "Unknown", - Action::Park => "Park", - Action::Retry => "Retry", - Action::Skip => "Skip", - Action::Stop => "Stop", + Self::Unknown => "Unknown", + Self::Park => "Park", + Self::Retry => "Retry", + Self::Skip => "Skip", + Self::Stop => "Stop", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -106,7 +100,6 @@ pub mod read_req { } } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Content { #[prost(message, tag = "1")] @@ -117,7 +110,6 @@ pub mod read_req { Nack(Nack), } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ReadResp { #[prost(oneof = "read_resp::Content", tags = "1, 2")] @@ -125,7 +117,6 @@ pub struct ReadResp { } /// Nested message and enum types in `ReadResp`. pub mod read_resp { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ReadEvent { #[prost(message, optional, tag = "1")] @@ -139,7 +130,6 @@ pub mod read_resp { } /// Nested message and enum types in `ReadEvent`. pub mod read_event { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RecordedEvent { #[prost(message, optional, tag = "1")] @@ -163,16 +153,14 @@ pub mod read_resp { #[prost(bytes = "bytes", tag = "8")] pub data: ::prost::bytes::Bytes, } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum Position { #[prost(uint64, tag = "3")] CommitPosition(u64), #[prost(message, tag = "4")] NoPosition(()), } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum Count { #[prost(int32, tag = "5")] RetryCount(i32), @@ -180,13 +168,11 @@ pub mod read_resp { NoRetryCount(()), } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SubscriptionConfirmation { #[prost(string, tag = "1")] pub subscription_id: ::prost::alloc::string::String, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Content { #[prost(message, tag = "1")] @@ -195,7 +181,6 @@ pub mod read_resp { SubscriptionConfirmation(SubscriptionConfirmation), } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CreateReq { #[prost(message, optional, tag = "1")] @@ -203,7 +188,6 @@ pub struct CreateReq { } /// Nested message and enum types in `CreateReq`. pub mod create_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[deprecated] @@ -219,7 +203,6 @@ pub mod create_req { } /// Nested message and enum types in `Options`. pub mod options { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum StreamOption { #[prost(message, tag = "4")] @@ -228,7 +211,6 @@ pub mod create_req { All(super::AllOptions), } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StreamOptions { #[prost(message, optional, tag = "1")] @@ -239,8 +221,7 @@ pub mod create_req { } /// Nested message and enum types in `StreamOptions`. pub mod stream_options { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum RevisionOption { #[prost(uint64, tag = "2")] Revision(u64), @@ -250,7 +231,6 @@ pub mod create_req { End(()), } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AllOptions { #[prost(oneof = "all_options::AllOption", tags = "1, 2, 3")] @@ -260,7 +240,6 @@ pub mod create_req { } /// Nested message and enum types in `AllOptions`. pub mod all_options { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FilterOptions { #[prost(uint32, tag = "5")] @@ -272,7 +251,6 @@ pub mod create_req { } /// Nested message and enum types in `FilterOptions`. pub mod filter_options { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Expression { #[prost(string, tag = "1")] @@ -280,7 +258,6 @@ pub mod create_req { #[prost(string, repeated, tag = "2")] pub prefix: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Filter { #[prost(message, tag = "1")] @@ -288,8 +265,7 @@ pub mod create_req { #[prost(message, tag = "2")] EventType(Expression), } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum Window { #[prost(uint32, tag = "3")] Max(u32), @@ -297,8 +273,7 @@ pub mod create_req { Count(()), } } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum AllOption { #[prost(message, tag = "1")] Position(super::Position), @@ -307,7 +282,6 @@ pub mod create_req { #[prost(message, tag = "3")] End(()), } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum FilterOption { #[prost(message, tag = "4")] @@ -316,15 +290,13 @@ pub mod create_req { NoFilter(()), } } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Position { #[prost(uint64, tag = "1")] pub commit_position: u64, #[prost(uint64, tag = "2")] pub prepare_position: u64, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Settings { #[prost(bool, tag = "1")] @@ -360,16 +332,14 @@ pub mod create_req { } /// Nested message and enum types in `Settings`. pub mod settings { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum MessageTimeout { #[prost(int64, tag = "4")] MessageTimeoutTicks(i64), #[prost(int32, tag = "14")] MessageTimeoutMs(i32), } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum CheckpointAfter { #[prost(int64, tag = "6")] CheckpointAfterTicks(i64), @@ -391,9 +361,9 @@ pub mod create_req { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ConsumerStrategy::DispatchToSingle => "DispatchToSingle", - ConsumerStrategy::RoundRobin => "RoundRobin", - ConsumerStrategy::Pinned => "Pinned", + Self::DispatchToSingle => "DispatchToSingle", + Self::RoundRobin => "RoundRobin", + Self::Pinned => "Pinned", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -407,10 +377,8 @@ pub mod create_req { } } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct CreateResp {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpdateReq { #[prost(message, optional, tag = "1")] @@ -418,7 +386,6 @@ pub struct UpdateReq { } /// Nested message and enum types in `UpdateReq`. pub mod update_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[deprecated] @@ -434,7 +401,6 @@ pub mod update_req { } /// Nested message and enum types in `Options`. pub mod options { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum StreamOption { #[prost(message, tag = "4")] @@ -443,7 +409,6 @@ pub mod update_req { All(super::AllOptions), } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StreamOptions { #[prost(message, optional, tag = "1")] @@ -454,8 +419,7 @@ pub mod update_req { } /// Nested message and enum types in `StreamOptions`. pub mod stream_options { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum RevisionOption { #[prost(uint64, tag = "2")] Revision(u64), @@ -465,16 +429,14 @@ pub mod update_req { End(()), } } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct AllOptions { #[prost(oneof = "all_options::AllOption", tags = "1, 2, 3")] pub all_option: ::core::option::Option, } /// Nested message and enum types in `AllOptions`. pub mod all_options { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum AllOption { #[prost(message, tag = "1")] Position(super::Position), @@ -484,16 +446,14 @@ pub mod update_req { End(()), } } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Position { #[prost(uint64, tag = "1")] pub commit_position: u64, #[prost(uint64, tag = "2")] pub prepare_position: u64, } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Settings { #[prost(bool, tag = "1")] pub resolve_links: bool, @@ -525,16 +485,14 @@ pub mod update_req { } /// Nested message and enum types in `Settings`. pub mod settings { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum MessageTimeout { #[prost(int64, tag = "4")] MessageTimeoutTicks(i64), #[prost(int32, tag = "14")] MessageTimeoutMs(i32), } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum CheckpointAfter { #[prost(int64, tag = "6")] CheckpointAfterTicks(i64), @@ -556,9 +514,9 @@ pub mod update_req { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ConsumerStrategy::DispatchToSingle => "DispatchToSingle", - ConsumerStrategy::RoundRobin => "RoundRobin", - ConsumerStrategy::Pinned => "Pinned", + Self::DispatchToSingle => "DispatchToSingle", + Self::RoundRobin => "RoundRobin", + Self::Pinned => "Pinned", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -572,10 +530,8 @@ pub mod update_req { } } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct UpdateResp {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DeleteReq { #[prost(message, optional, tag = "1")] @@ -583,7 +539,6 @@ pub struct DeleteReq { } /// Nested message and enum types in `DeleteReq`. pub mod delete_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(string, tag = "2")] @@ -593,7 +548,6 @@ pub mod delete_req { } /// Nested message and enum types in `Options`. pub mod options { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum StreamOption { #[prost(message, tag = "1")] @@ -603,10 +557,8 @@ pub mod delete_req { } } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct DeleteResp {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetInfoReq { #[prost(message, optional, tag = "1")] @@ -614,7 +566,6 @@ pub struct GetInfoReq { } /// Nested message and enum types in `GetInfoReq`. pub mod get_info_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(string, tag = "3")] @@ -624,7 +575,6 @@ pub mod get_info_req { } /// Nested message and enum types in `Options`. pub mod options { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum StreamOption { #[prost(message, tag = "1")] @@ -634,13 +584,11 @@ pub mod get_info_req { } } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetInfoResp { #[prost(message, optional, tag = "1")] pub subscription_info: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SubscriptionInfo { #[prost(string, tag = "1")] @@ -702,7 +650,6 @@ pub struct SubscriptionInfo { } /// Nested message and enum types in `SubscriptionInfo`. pub mod subscription_info { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConnectionInfo { #[prost(string, tag = "1")] @@ -724,7 +671,6 @@ pub mod subscription_info { #[prost(string, tag = "9")] pub connection_name: ::prost::alloc::string::String, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Measurement { #[prost(string, tag = "1")] @@ -733,7 +679,6 @@ pub mod subscription_info { pub value: i64, } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ReplayParkedReq { #[prost(message, optional, tag = "1")] @@ -741,7 +686,6 @@ pub struct ReplayParkedReq { } /// Nested message and enum types in `ReplayParkedReq`. pub mod replay_parked_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(string, tag = "1")] @@ -753,7 +697,6 @@ pub mod replay_parked_req { } /// Nested message and enum types in `Options`. pub mod options { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum StreamOption { #[prost(message, tag = "2")] @@ -761,8 +704,7 @@ pub mod replay_parked_req { #[prost(message, tag = "3")] All(()), } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum StopAtOption { #[prost(int64, tag = "4")] StopAt(i64), @@ -771,10 +713,8 @@ pub mod replay_parked_req { } } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct ReplayParkedResp {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListReq { #[prost(message, optional, tag = "1")] @@ -782,7 +722,6 @@ pub struct ListReq { } /// Nested message and enum types in `ListReq`. pub mod list_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(oneof = "options::ListOption", tags = "1, 2")] @@ -790,7 +729,6 @@ pub mod list_req { } /// Nested message and enum types in `Options`. pub mod options { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum ListOption { #[prost(message, tag = "1")] @@ -799,7 +737,6 @@ pub mod list_req { ListForStream(super::StreamOption), } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StreamOption { #[prost(oneof = "stream_option::StreamOption", tags = "1, 2")] @@ -807,7 +744,6 @@ pub mod list_req { } /// Nested message and enum types in `StreamOption`. pub mod stream_option { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum StreamOption { #[prost(message, tag = "1")] @@ -817,7 +753,6 @@ pub mod list_req { } } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListResp { #[prost(message, repeated, tag = "1")] @@ -825,7 +760,13 @@ pub struct ListResp { } /// Generated client implementations. pub mod persistent_subscriptions_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value + )] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -847,8 +788,8 @@ pub mod persistent_subscriptions_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -872,7 +813,7 @@ pub mod persistent_subscriptions_client { >, >, >>::Error: - Into + Send + Sync, + Into + std::marker::Send + std::marker::Sync, { PersistentSubscriptionsClient::new(InterceptedService::new(inner, interceptor)) } @@ -912,10 +853,7 @@ pub mod persistent_subscriptions_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -933,10 +871,7 @@ pub mod persistent_subscriptions_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -954,10 +889,7 @@ pub mod persistent_subscriptions_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -978,10 +910,7 @@ pub mod persistent_subscriptions_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -999,10 +928,7 @@ pub mod persistent_subscriptions_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -1020,10 +946,7 @@ pub mod persistent_subscriptions_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -1041,10 +964,7 @@ pub mod persistent_subscriptions_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -1062,10 +982,7 @@ pub mod persistent_subscriptions_client { request: impl tonic::IntoRequest<()>, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( diff --git a/eventstore/src/event_store/generated/projections.rs b/eventstore/src/event_store/generated/projections.rs index 32f018d5..92b9075a 100644 --- a/eventstore/src/event_store/generated/projections.rs +++ b/eventstore/src/event_store/generated/projections.rs @@ -1,4 +1,4 @@ -#[allow(clippy::derive_partial_eq_without_eq)] +// This file is @generated by prost-build. #[derive(Clone, PartialEq, ::prost::Message)] pub struct CreateReq { #[prost(message, optional, tag = "1")] @@ -6,7 +6,6 @@ pub struct CreateReq { } /// Nested message and enum types in `CreateReq`. pub mod create_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(string, tag = "4")] @@ -16,13 +15,11 @@ pub mod create_req { } /// Nested message and enum types in `Options`. pub mod options { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Transient { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Continuous { #[prost(string, tag = "1")] @@ -30,7 +27,6 @@ pub mod create_req { #[prost(bool, tag = "2")] pub track_emitted_streams: bool, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Mode { #[prost(message, tag = "1")] @@ -42,10 +38,8 @@ pub mod create_req { } } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct CreateResp {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpdateReq { #[prost(message, optional, tag = "1")] @@ -53,7 +47,6 @@ pub struct UpdateReq { } /// Nested message and enum types in `UpdateReq`. pub mod update_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(string, tag = "1")] @@ -65,8 +58,7 @@ pub mod update_req { } /// Nested message and enum types in `Options`. pub mod options { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum EmitOption { #[prost(bool, tag = "3")] EmitEnabled(bool), @@ -75,10 +67,8 @@ pub mod update_req { } } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct UpdateResp {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DeleteReq { #[prost(message, optional, tag = "1")] @@ -86,7 +76,6 @@ pub struct DeleteReq { } /// Nested message and enum types in `DeleteReq`. pub mod delete_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(string, tag = "1")] @@ -99,10 +88,8 @@ pub mod delete_req { pub delete_checkpoint_stream: bool, } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct DeleteResp {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StatisticsReq { #[prost(message, optional, tag = "1")] @@ -110,7 +97,6 @@ pub struct StatisticsReq { } /// Nested message and enum types in `StatisticsReq`. pub mod statistics_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(oneof = "options::Mode", tags = "1, 2, 3, 4, 5")] @@ -118,7 +104,6 @@ pub mod statistics_req { } /// Nested message and enum types in `Options`. pub mod options { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Mode { #[prost(string, tag = "1")] @@ -134,7 +119,6 @@ pub mod statistics_req { } } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StatisticsResp { #[prost(message, optional, tag = "1")] @@ -142,7 +126,6 @@ pub struct StatisticsResp { } /// Nested message and enum types in `StatisticsResp`. pub mod statistics_resp { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Details { #[prost(int64, tag = "1")] @@ -185,7 +168,6 @@ pub mod statistics_resp { pub write_pending_events_after_checkpoint: i32, } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StateReq { #[prost(message, optional, tag = "1")] @@ -193,7 +175,6 @@ pub struct StateReq { } /// Nested message and enum types in `StateReq`. pub mod state_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(string, tag = "1")] @@ -202,13 +183,11 @@ pub mod state_req { pub partition: ::prost::alloc::string::String, } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StateResp { #[prost(message, optional, tag = "1")] pub state: ::core::option::Option<::prost_types::Value>, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResultReq { #[prost(message, optional, tag = "1")] @@ -216,7 +195,6 @@ pub struct ResultReq { } /// Nested message and enum types in `ResultReq`. pub mod result_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(string, tag = "1")] @@ -225,13 +203,11 @@ pub mod result_req { pub partition: ::prost::alloc::string::String, } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResultResp { #[prost(message, optional, tag = "1")] pub result: ::core::option::Option<::prost_types::Value>, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResetReq { #[prost(message, optional, tag = "1")] @@ -239,7 +215,6 @@ pub struct ResetReq { } /// Nested message and enum types in `ResetReq`. pub mod reset_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(string, tag = "1")] @@ -248,10 +223,8 @@ pub mod reset_req { pub write_checkpoint: bool, } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct ResetResp {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EnableReq { #[prost(message, optional, tag = "1")] @@ -259,17 +232,14 @@ pub struct EnableReq { } /// Nested message and enum types in `EnableReq`. pub mod enable_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct EnableResp {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DisableReq { #[prost(message, optional, tag = "1")] @@ -277,7 +247,6 @@ pub struct DisableReq { } /// Nested message and enum types in `DisableReq`. pub mod disable_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(string, tag = "1")] @@ -286,12 +255,17 @@ pub mod disable_req { pub write_checkpoint: bool, } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct DisableResp {} /// Generated client implementations. pub mod projections_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value + )] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -313,8 +287,8 @@ pub mod projections_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -338,7 +312,7 @@ pub mod projections_client { >, >, >>::Error: - Into + Send + Sync, + Into + std::marker::Send + std::marker::Sync, { ProjectionsClient::new(InterceptedService::new(inner, interceptor)) } @@ -378,10 +352,7 @@ pub mod projections_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -399,10 +370,7 @@ pub mod projections_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -420,10 +388,7 @@ pub mod projections_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -444,10 +409,7 @@ pub mod projections_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -465,10 +427,7 @@ pub mod projections_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -486,10 +445,7 @@ pub mod projections_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -507,10 +463,7 @@ pub mod projections_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -528,10 +481,7 @@ pub mod projections_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -549,10 +499,7 @@ pub mod projections_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -570,10 +517,7 @@ pub mod projections_client { request: impl tonic::IntoRequest<()>, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( diff --git a/eventstore/src/event_store/generated/server_features.rs b/eventstore/src/event_store/generated/server_features.rs index 5e8678a8..054e8b91 100644 --- a/eventstore/src/event_store/generated/server_features.rs +++ b/eventstore/src/event_store/generated/server_features.rs @@ -1,4 +1,4 @@ -#[allow(clippy::derive_partial_eq_without_eq)] +// This file is @generated by prost-build. #[derive(Clone, PartialEq, ::prost::Message)] pub struct SupportedMethods { #[prost(message, repeated, tag = "1")] @@ -6,7 +6,6 @@ pub struct SupportedMethods { #[prost(string, tag = "2")] pub event_store_server_version: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SupportedMethod { #[prost(string, tag = "1")] @@ -18,7 +17,13 @@ pub struct SupportedMethod { } /// Generated client implementations. pub mod server_features_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value + )] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -40,8 +45,8 @@ pub mod server_features_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -65,7 +70,7 @@ pub mod server_features_client { >, >, >>::Error: - Into + Send + Sync, + Into + std::marker::Send + std::marker::Sync, { ServerFeaturesClient::new(InterceptedService::new(inner, interceptor)) } @@ -105,10 +110,7 @@ pub mod server_features_client { request: impl tonic::IntoRequest<()>, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( diff --git a/eventstore/src/event_store/generated/streams.rs b/eventstore/src/event_store/generated/streams.rs index f7172388..3e30e057 100644 --- a/eventstore/src/event_store/generated/streams.rs +++ b/eventstore/src/event_store/generated/streams.rs @@ -1,4 +1,4 @@ -#[allow(clippy::derive_partial_eq_without_eq)] +// This file is @generated by prost-build. #[derive(Clone, PartialEq, ::prost::Message)] pub struct ReadReq { #[prost(message, optional, tag = "1")] @@ -6,7 +6,6 @@ pub struct ReadReq { } /// Nested message and enum types in `ReadReq`. pub mod read_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(enumeration = "options::ReadDirection", tag = "3")] @@ -26,7 +25,6 @@ pub mod read_req { } /// Nested message and enum types in `Options`. pub mod options { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StreamOptions { #[prost(message, optional, tag = "1")] @@ -37,8 +35,7 @@ pub mod read_req { } /// Nested message and enum types in `StreamOptions`. pub mod stream_options { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum RevisionOption { #[prost(uint64, tag = "2")] Revision(u64), @@ -48,16 +45,14 @@ pub mod read_req { End(()), } } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct AllOptions { #[prost(oneof = "all_options::AllOption", tags = "1, 2, 3")] pub all_option: ::core::option::Option, } /// Nested message and enum types in `AllOptions`. pub mod all_options { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum AllOption { #[prost(message, tag = "1")] Position(super::Position), @@ -67,18 +62,15 @@ pub mod read_req { End(()), } } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct SubscriptionOptions {} - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Position { #[prost(uint64, tag = "1")] pub commit_position: u64, #[prost(uint64, tag = "2")] pub prepare_position: u64, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FilterOptions { #[prost(uint32, tag = "5")] @@ -90,7 +82,6 @@ pub mod read_req { } /// Nested message and enum types in `FilterOptions`. pub mod filter_options { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Expression { #[prost(string, tag = "1")] @@ -98,7 +89,6 @@ pub mod read_req { #[prost(string, repeated, tag = "2")] pub prefix: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Filter { #[prost(message, tag = "1")] @@ -106,8 +96,7 @@ pub mod read_req { #[prost(message, tag = "2")] EventType(Expression), } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum Window { #[prost(uint32, tag = "3")] Max(u32), @@ -115,16 +104,14 @@ pub mod read_req { Count(()), } } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct UuidOption { #[prost(oneof = "uuid_option::Content", tags = "1, 2")] pub content: ::core::option::Option, } /// Nested message and enum types in `UUIDOption`. pub mod uuid_option { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum Content { #[prost(message, tag = "1")] Structured(()), @@ -132,8 +119,7 @@ pub mod read_req { String(()), } } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct ControlOption { #[prost(uint32, tag = "1")] pub compatibility: u32, @@ -153,8 +139,8 @@ pub mod read_req { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ReadDirection::Forwards => "Forwards", - ReadDirection::Backwards => "Backwards", + Self::Forwards => "Forwards", + Self::Backwards => "Backwards", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -166,7 +152,6 @@ pub mod read_req { } } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum StreamOption { #[prost(message, tag = "1")] @@ -174,15 +159,13 @@ pub mod read_req { #[prost(message, tag = "2")] All(AllOptions), } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum CountOption { #[prost(uint64, tag = "5")] Count(u64), #[prost(message, tag = "6")] Subscription(SubscriptionOptions), } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum FilterOption { #[prost(message, tag = "7")] @@ -192,7 +175,6 @@ pub mod read_req { } } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ReadResp { #[prost(oneof = "read_resp::Content", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9")] @@ -200,13 +182,10 @@ pub struct ReadResp { } /// Nested message and enum types in `ReadResp`. pub mod read_resp { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct CaughtUp {} - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct FellBehind {} - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ReadEvent { #[prost(message, optional, tag = "1")] @@ -218,7 +197,6 @@ pub mod read_resp { } /// Nested message and enum types in `ReadEvent`. pub mod read_event { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RecordedEvent { #[prost(message, optional, tag = "1")] @@ -242,8 +220,7 @@ pub mod read_resp { #[prost(bytes = "bytes", tag = "8")] pub data: ::prost::bytes::Bytes, } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum Position { #[prost(uint64, tag = "3")] CommitPosition(u64), @@ -251,28 +228,24 @@ pub mod read_resp { NoPosition(()), } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SubscriptionConfirmation { #[prost(string, tag = "1")] pub subscription_id: ::prost::alloc::string::String, } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Checkpoint { #[prost(uint64, tag = "1")] pub commit_position: u64, #[prost(uint64, tag = "2")] pub prepare_position: u64, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StreamNotFound { #[prost(message, optional, tag = "1")] pub stream_identifier: ::core::option::Option, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Content { #[prost(message, tag = "1")] @@ -295,7 +268,6 @@ pub mod read_resp { FellBehind(FellBehind), } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AppendReq { #[prost(oneof = "append_req::Content", tags = "1, 2")] @@ -303,7 +275,6 @@ pub struct AppendReq { } /// Nested message and enum types in `AppendReq`. pub mod append_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(message, optional, tag = "1")] @@ -314,8 +285,7 @@ pub mod append_req { } /// Nested message and enum types in `Options`. pub mod options { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum ExpectedStreamRevision { #[prost(uint64, tag = "2")] Revision(u64), @@ -327,7 +297,6 @@ pub mod append_req { StreamExists(()), } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProposedMessage { #[prost(message, optional, tag = "1")] @@ -342,7 +311,6 @@ pub mod append_req { #[prost(bytes = "bytes", tag = "4")] pub data: ::prost::bytes::Bytes, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Content { #[prost(message, tag = "1")] @@ -351,24 +319,21 @@ pub mod append_req { ProposedMessage(ProposedMessage), } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct AppendResp { #[prost(oneof = "append_resp::Result", tags = "1, 2")] pub result: ::core::option::Option, } /// Nested message and enum types in `AppendResp`. pub mod append_resp { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Position { #[prost(uint64, tag = "1")] pub commit_position: u64, #[prost(uint64, tag = "2")] pub prepare_position: u64, } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Success { #[prost(oneof = "success::CurrentRevisionOption", tags = "1, 2")] pub current_revision_option: ::core::option::Option, @@ -377,16 +342,14 @@ pub mod append_resp { } /// Nested message and enum types in `Success`. pub mod success { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum CurrentRevisionOption { #[prost(uint64, tag = "1")] CurrentRevision(u64), #[prost(message, tag = "2")] NoStream(()), } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum PositionOption { #[prost(message, tag = "3")] Position(super::Position), @@ -394,8 +357,7 @@ pub mod append_resp { NoPosition(()), } } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct WrongExpectedVersion { #[prost( oneof = "wrong_expected_version::CurrentRevisionOption2060", @@ -421,16 +383,14 @@ pub mod append_resp { } /// Nested message and enum types in `WrongExpectedVersion`. pub mod wrong_expected_version { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum CurrentRevisionOption2060 { #[prost(uint64, tag = "1")] CurrentRevision2060(u64), #[prost(message, tag = "2")] NoStream2060(()), } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum ExpectedRevisionOption2060 { #[prost(uint64, tag = "3")] ExpectedRevision2060(u64), @@ -439,16 +399,14 @@ pub mod append_resp { #[prost(message, tag = "5")] StreamExists2060(()), } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum CurrentRevisionOption { #[prost(uint64, tag = "6")] CurrentRevision(u64), #[prost(message, tag = "7")] CurrentNoStream(()), } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum ExpectedRevisionOption { #[prost(uint64, tag = "8")] ExpectedRevision(u64), @@ -460,8 +418,7 @@ pub mod append_resp { ExpectedNoStream(()), } } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum Result { #[prost(message, tag = "1")] Success(Success), @@ -469,7 +426,6 @@ pub mod append_resp { WrongExpectedVersion(WrongExpectedVersion), } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BatchAppendReq { #[prost(message, optional, tag = "1")] @@ -483,7 +439,6 @@ pub struct BatchAppendReq { } /// Nested message and enum types in `BatchAppendReq`. pub mod batch_append_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(message, optional, tag = "1")] @@ -496,8 +451,7 @@ pub mod batch_append_req { } /// Nested message and enum types in `Options`. pub mod options { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum ExpectedStreamPosition { #[prost(uint64, tag = "2")] StreamPosition(u64), @@ -508,8 +462,7 @@ pub mod batch_append_req { #[prost(message, tag = "5")] StreamExists(()), } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum DeadlineOption { #[prost(message, tag = "6")] Deadline21100(::prost_types::Timestamp), @@ -517,7 +470,6 @@ pub mod batch_append_req { Deadline(::prost_types::Duration), } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProposedMessage { #[prost(message, optional, tag = "1")] @@ -533,7 +485,6 @@ pub mod batch_append_req { pub data: ::prost::bytes::Bytes, } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BatchAppendResp { #[prost(message, optional, tag = "1")] @@ -551,8 +502,7 @@ pub struct BatchAppendResp { } /// Nested message and enum types in `BatchAppendResp`. pub mod batch_append_resp { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Success { #[prost(oneof = "success::CurrentRevisionOption", tags = "1, 2")] pub current_revision_option: ::core::option::Option, @@ -561,16 +511,14 @@ pub mod batch_append_resp { } /// Nested message and enum types in `Success`. pub mod success { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum CurrentRevisionOption { #[prost(uint64, tag = "1")] CurrentRevision(u64), #[prost(message, tag = "2")] NoStream(()), } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum PositionOption { #[prost(message, tag = "3")] Position(crate::event_store::generated::common::AllStreamPosition), @@ -578,7 +526,6 @@ pub mod batch_append_resp { NoPosition(()), } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Result { #[prost(message, tag = "2")] @@ -586,8 +533,7 @@ pub mod batch_append_resp { #[prost(message, tag = "3")] Success(Success), } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum ExpectedStreamPosition { #[prost(uint64, tag = "5")] StreamPosition(u64), @@ -599,7 +545,6 @@ pub mod batch_append_resp { StreamExists(()), } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DeleteReq { #[prost(message, optional, tag = "1")] @@ -607,7 +552,6 @@ pub struct DeleteReq { } /// Nested message and enum types in `DeleteReq`. pub mod delete_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(message, optional, tag = "1")] @@ -618,8 +562,7 @@ pub mod delete_req { } /// Nested message and enum types in `Options`. pub mod options { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum ExpectedStreamRevision { #[prost(uint64, tag = "2")] Revision(u64), @@ -632,24 +575,21 @@ pub mod delete_req { } } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct DeleteResp { #[prost(oneof = "delete_resp::PositionOption", tags = "1, 2")] pub position_option: ::core::option::Option, } /// Nested message and enum types in `DeleteResp`. pub mod delete_resp { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Position { #[prost(uint64, tag = "1")] pub commit_position: u64, #[prost(uint64, tag = "2")] pub prepare_position: u64, } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum PositionOption { #[prost(message, tag = "1")] Position(Position), @@ -657,7 +597,6 @@ pub mod delete_resp { NoPosition(()), } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TombstoneReq { #[prost(message, optional, tag = "1")] @@ -665,7 +604,6 @@ pub struct TombstoneReq { } /// Nested message and enum types in `TombstoneReq`. pub mod tombstone_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(message, optional, tag = "1")] @@ -676,8 +614,7 @@ pub mod tombstone_req { } /// Nested message and enum types in `Options`. pub mod options { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum ExpectedStreamRevision { #[prost(uint64, tag = "2")] Revision(u64), @@ -690,24 +627,21 @@ pub mod tombstone_req { } } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct TombstoneResp { #[prost(oneof = "tombstone_resp::PositionOption", tags = "1, 2")] pub position_option: ::core::option::Option, } /// Nested message and enum types in `TombstoneResp`. pub mod tombstone_resp { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Position { #[prost(uint64, tag = "1")] pub commit_position: u64, #[prost(uint64, tag = "2")] pub prepare_position: u64, } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum PositionOption { #[prost(message, tag = "1")] Position(Position), @@ -717,7 +651,13 @@ pub mod tombstone_resp { } /// Generated client implementations. pub mod streams_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value + )] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -739,8 +679,8 @@ pub mod streams_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -764,7 +704,7 @@ pub mod streams_client { >, >, >>::Error: - Into + Send + Sync, + Into + std::marker::Send + std::marker::Sync, { StreamsClient::new(InterceptedService::new(inner, interceptor)) } @@ -807,10 +747,7 @@ pub mod streams_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -827,10 +764,7 @@ pub mod streams_client { request: impl tonic::IntoStreamingRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -847,10 +781,7 @@ pub mod streams_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -867,10 +798,7 @@ pub mod streams_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -891,10 +819,7 @@ pub mod streams_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( diff --git a/eventstore/src/event_store/generated/users.rs b/eventstore/src/event_store/generated/users.rs index fb9d41ea..b9244c26 100644 --- a/eventstore/src/event_store/generated/users.rs +++ b/eventstore/src/event_store/generated/users.rs @@ -1,4 +1,4 @@ -#[allow(clippy::derive_partial_eq_without_eq)] +// This file is @generated by prost-build. #[derive(Clone, PartialEq, ::prost::Message)] pub struct CreateReq { #[prost(message, optional, tag = "1")] @@ -6,7 +6,6 @@ pub struct CreateReq { } /// Nested message and enum types in `CreateReq`. pub mod create_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(string, tag = "1")] @@ -19,10 +18,8 @@ pub mod create_req { pub groups: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct CreateResp {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpdateReq { #[prost(message, optional, tag = "1")] @@ -30,7 +27,6 @@ pub struct UpdateReq { } /// Nested message and enum types in `UpdateReq`. pub mod update_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(string, tag = "1")] @@ -43,10 +39,8 @@ pub mod update_req { pub groups: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct UpdateResp {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DeleteReq { #[prost(message, optional, tag = "1")] @@ -54,17 +48,14 @@ pub struct DeleteReq { } /// Nested message and enum types in `DeleteReq`. pub mod delete_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(string, tag = "1")] pub login_name: ::prost::alloc::string::String, } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct DeleteResp {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EnableReq { #[prost(message, optional, tag = "1")] @@ -72,17 +63,14 @@ pub struct EnableReq { } /// Nested message and enum types in `EnableReq`. pub mod enable_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(string, tag = "1")] pub login_name: ::prost::alloc::string::String, } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct EnableResp {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DisableReq { #[prost(message, optional, tag = "1")] @@ -90,17 +78,14 @@ pub struct DisableReq { } /// Nested message and enum types in `DisableReq`. pub mod disable_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(string, tag = "1")] pub login_name: ::prost::alloc::string::String, } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct DisableResp {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DetailsReq { #[prost(message, optional, tag = "1")] @@ -108,14 +93,12 @@ pub struct DetailsReq { } /// Nested message and enum types in `DetailsReq`. pub mod details_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(string, tag = "1")] pub login_name: ::prost::alloc::string::String, } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DetailsResp { #[prost(message, optional, tag = "1")] @@ -123,7 +106,6 @@ pub struct DetailsResp { } /// Nested message and enum types in `DetailsResp`. pub mod details_resp { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UserDetails { #[prost(string, tag = "1")] @@ -139,15 +121,13 @@ pub mod details_resp { } /// Nested message and enum types in `UserDetails`. pub mod user_details { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct DateTime { #[prost(int64, tag = "1")] pub ticks_since_epoch: i64, } } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ChangePasswordReq { #[prost(message, optional, tag = "1")] @@ -155,7 +135,6 @@ pub struct ChangePasswordReq { } /// Nested message and enum types in `ChangePasswordReq`. pub mod change_password_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(string, tag = "1")] @@ -166,10 +145,8 @@ pub mod change_password_req { pub new_password: ::prost::alloc::string::String, } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct ChangePasswordResp {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResetPasswordReq { #[prost(message, optional, tag = "1")] @@ -177,7 +154,6 @@ pub struct ResetPasswordReq { } /// Nested message and enum types in `ResetPasswordReq`. pub mod reset_password_req { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Options { #[prost(string, tag = "1")] @@ -186,12 +162,17 @@ pub mod reset_password_req { pub new_password: ::prost::alloc::string::String, } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct ResetPasswordResp {} /// Generated client implementations. pub mod users_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value + )] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -213,8 +194,8 @@ pub mod users_client { where T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -238,7 +219,7 @@ pub mod users_client { >, >, >>::Error: - Into + Send + Sync, + Into + std::marker::Send + std::marker::Sync, { UsersClient::new(InterceptedService::new(inner, interceptor)) } @@ -278,10 +259,7 @@ pub mod users_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -296,10 +274,7 @@ pub mod users_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -314,10 +289,7 @@ pub mod users_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -332,10 +304,7 @@ pub mod users_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -350,10 +319,7 @@ pub mod users_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -371,10 +337,7 @@ pub mod users_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -390,10 +353,7 @@ pub mod users_client { ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -411,10 +371,7 @@ pub mod users_client { request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( diff --git a/eventstore/src/grpc.rs b/eventstore/src/grpc.rs index 07357852..903e6e4c 100644 --- a/eventstore/src/grpc.rs +++ b/eventstore/src/grpc.rs @@ -1,15 +1,18 @@ use std::cmp::Ordering; -use std::fmt::Display; +use std::fmt::{Debug, Display}; use std::str::FromStr; use std::time::Duration; use futures::Future; -use hyper::client::HttpConnector; use hyper_rustls::HttpsConnector; +use hyper_util::client::legacy::connect::HttpConnector; use nom::lib::std::fmt::Formatter; use rand::rngs::SmallRng; use rand::seq::SliceRandom; use rand::{RngCore, SeedableRng}; +use rustls::client::danger::{HandshakeSignatureValid, ServerCertVerified}; +use rustls::pki_types::{CertificateDer, ServerName, UnixTime}; +use rustls::{DigitallySignedStruct, SignatureScheme}; use serde::de::{Error, Visitor}; use serde::{Deserialize, Serialize}; use serde::{Deserializer, Serializer}; @@ -24,19 +27,55 @@ use crate::server_features::{Features, ServerInfo}; use crate::types::{Endpoint, GrpcConnectionError}; use crate::{Credentials, DnsClusterSettings, NodePreference}; +#[derive(Debug)] struct NoVerification; -impl rustls::client::ServerCertVerifier for NoVerification { +impl rustls::client::danger::ServerCertVerifier for NoVerification { fn verify_server_cert( &self, - _end_entity: &rustls::Certificate, - _intermediates: &[rustls::Certificate], - _server_name: &rustls::ServerName, - _scts: &mut dyn Iterator, + _end_entity: &CertificateDer<'_>, + _intermediates: &[CertificateDer<'_>], + _server_name: &ServerName<'_>, _ocsp_response: &[u8], - _now: std::time::SystemTime, - ) -> Result { - Ok(rustls::client::ServerCertVerified::assertion()) + _now: UnixTime, + ) -> Result { + Ok(ServerCertVerified::assertion()) + } + + fn verify_tls12_signature( + &self, + _message: &[u8], + _cert: &CertificateDer<'_>, + _dss: &DigitallySignedStruct, + ) -> Result { + Ok(HandshakeSignatureValid::assertion()) + } + + fn verify_tls13_signature( + &self, + _message: &[u8], + _cert: &CertificateDer<'_>, + _dss: &DigitallySignedStruct, + ) -> Result { + Ok(HandshakeSignatureValid::assertion()) + } + + fn supported_verify_schemes(&self) -> Vec { + vec![ + SignatureScheme::RSA_PKCS1_SHA1, + SignatureScheme::ECDSA_SHA1_Legacy, + SignatureScheme::RSA_PKCS1_SHA256, + SignatureScheme::ECDSA_NISTP256_SHA256, + SignatureScheme::RSA_PKCS1_SHA384, + SignatureScheme::ECDSA_NISTP384_SHA384, + SignatureScheme::RSA_PKCS1_SHA512, + SignatureScheme::ECDSA_NISTP521_SHA512, + SignatureScheme::RSA_PSS_SHA256, + SignatureScheme::RSA_PSS_SHA384, + SignatureScheme::RSA_PSS_SHA512, + SignatureScheme::ED25519, + SignatureScheme::ED448, + ] } } @@ -107,7 +146,7 @@ impl std::error::Error for ClientSettingsParseError {} struct DurationVisitor; -impl<'de> Visitor<'de> for DurationVisitor { +impl Visitor<'_> for DurationVisitor { type Value = Duration; fn expecting(&self, f: &mut Formatter<'_>) -> std::fmt::Result { @@ -707,7 +746,8 @@ pub(crate) mod defaults { pub const KEEP_ALIVE_TIMEOUT_IN_MS: u64 = 10_000; } -pub(crate) type HyperClient = hyper::Client, tonic::body::BoxBody>; +pub(crate) type HyperClient = + hyper_util::client::legacy::Client, tonic::body::BoxBody>; struct NodeConnection { id: Uuid, @@ -746,11 +786,14 @@ impl NodeConnection { for cert in rustls_native_certs::load_native_certs().expect("could not load platform certs") { - roots.add(&rustls::Certificate(cert.0)).unwrap(); + roots.add(cert).unwrap(); } + rustls::crypto::aws_lc_rs::default_provider() + .install_default() + .expect("failed to install rustls crypto provider"); + let mut tls = tokio_rustls::rustls::ClientConfig::builder() - .with_safe_defaults() .with_root_certificates(roots) .with_no_client_auth(); @@ -772,11 +815,13 @@ impl NodeConnection { }) .service(http); - let client = hyper::Client::builder() - .http2_only(true) - .http2_keep_alive_interval(settings.keep_alive_interval) - .http2_keep_alive_timeout(settings.keep_alive_timeout) - .build::<_, tonic::body::BoxBody>(connector); + let client = + hyper_util::client::legacy::Client::builder(hyper_util::rt::TokioExecutor::new()) + .timer(hyper_util::rt::tokio::TokioTimer::new()) + .http2_only(true) + .http2_keep_alive_interval(settings.keep_alive_interval) + .http2_keep_alive_timeout(settings.keep_alive_timeout) + .build::<_, tonic::body::BoxBody>(connector); let cluster_mode = if settings.dns_discover || settings.hosts().len() > 1 { let mode = if settings.dns_discover { diff --git a/eventstore/src/request.rs b/eventstore/src/request.rs index b416a881..a02a2f67 100644 --- a/eventstore/src/request.rs +++ b/eventstore/src/request.rs @@ -1,5 +1,6 @@ use crate::options::CommonOperationOptions; use crate::{ClientSettings, NodePreference}; +use base64::Engine; pub(crate) fn build_request_metadata( settings: &ClientSettings, @@ -19,7 +20,8 @@ where let login = String::from_utf8_lossy(&creds.login).into_owned(); let password = String::from_utf8_lossy(&creds.password).into_owned(); - let basic_auth_string = base64::encode(format!("{}:{}", login, password)); + let basic_auth_string = + base64::engine::general_purpose::STANDARD.encode(format!("{}:{}", login, password)); let basic_auth = format!("Basic {}", basic_auth_string); let header_value = MetadataValue::try_from(basic_auth.as_str()) .expect("Auth header value should be valid metadata header value"); diff --git a/eventstore/src/types.rs b/eventstore/src/types.rs index abd5814f..9b49e3f7 100755 --- a/eventstore/src/types.rs +++ b/eventstore/src/types.rs @@ -408,12 +408,12 @@ pub struct EventData { impl EventData { /// Creates an event with a JSON payload. - pub fn json(event_type: S, payload: P) -> serde_json::Result + pub fn json(event_type: S, payload: &P) -> serde_json::Result where P: Serialize, S: AsRef, { - let payload = Bytes::from(serde_json::to_vec(&payload)?); + let payload = Bytes::from(serde_json::to_vec(payload)?); let mut metadata = HashMap::new(); metadata.insert("type".to_owned(), event_type.as_ref().to_owned()); metadata.insert("content-type".to_owned(), "application/json".to_owned()); @@ -455,11 +455,11 @@ impl EventData { } /// Assigns a JSON metadata to this event. - pub fn metadata_as_json

(self, payload: P) -> serde_json::Result + pub fn metadata_as_json

(self, payload: &P) -> serde_json::Result where P: Serialize, { - let custom_metadata = Some(Bytes::from(serde_json::to_vec(&payload)?)); + let custom_metadata = Some(Bytes::from(serde_json::to_vec(payload)?)); Ok(EventData { custom_metadata, ..self @@ -667,20 +667,20 @@ where struct DurationVisitor; -impl<'de> Visitor<'de> for DurationVisitor { +impl Visitor<'_> for DurationVisitor { type Value = Option; fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { write!(formatter, "a time duration in milliseconds") } - fn visit_none(self) -> std::result::Result { - Ok(None) - } - fn visit_u64(self, value: u64) -> std::result::Result { Ok(Some(Duration::from_millis(value))) } + + fn visit_none(self) -> std::result::Result { + Ok(None) + } } struct AclVisitor; @@ -692,13 +692,6 @@ impl<'de> Visitor<'de> for AclVisitor { write!(formatter, "a EventStoreDB ACL") } - fn visit_none(self) -> std::result::Result - where - E: serde::de::Error, - { - Ok(None) - } - fn visit_str(self, value: &str) -> std::result::Result where E: serde::de::Error, @@ -713,6 +706,13 @@ impl<'de> Visitor<'de> for AclVisitor { } } + fn visit_none(self) -> std::result::Result + where + E: serde::de::Error, + { + Ok(None) + } + fn visit_map(self, map: M) -> std::result::Result where M: serde::de::MapAccess<'de>, @@ -1739,7 +1739,7 @@ impl Serialize for StreamPosition { struct PositionVisitor; -impl<'de> serde::de::Visitor<'de> for PositionVisitor { +impl Visitor<'_> for PositionVisitor { type Value = Position; fn expecting(&self, formatter: &mut Formatter) -> std::fmt::Result { @@ -1790,7 +1790,7 @@ impl<'de> Deserialize<'de> for StreamPosition { struct StreamRevOrPosVisitor; -impl<'de> serde::de::Visitor<'de> for StreamRevOrPosVisitor { +impl Visitor<'_> for StreamRevOrPosVisitor { type Value = StreamPosition; fn expecting(&self, formatter: &mut Formatter) -> std::fmt::Result { @@ -1923,7 +1923,7 @@ impl StreamName for Bytes { } } -impl<'a> StreamName for &'a str { +impl StreamName for &str { fn into_stream_name(self) -> Bytes { self.to_string().into() } @@ -1945,7 +1945,7 @@ impl MetadataStreamName for Bytes { } } -impl<'a> MetadataStreamName for &'a str { +impl MetadataStreamName for &str { fn into_metadata_stream_name(self) -> Bytes { format!("$${}", self).to_string().into() } diff --git a/eventstore/tests/api/streams.rs b/eventstore/tests/api/streams.rs index 4d2664e3..efe0b177 100644 --- a/eventstore/tests/api/streams.rs +++ b/eventstore/tests/api/streams.rs @@ -150,7 +150,7 @@ async fn test_metadata(client: &Client) -> eventstore::Result<()> { .build(); let _ = client - .set_stream_metadata(stream_id.as_str(), &Default::default(), expected.clone()) + .set_stream_metadata(stream_id.as_str(), &Default::default(), &expected) .await?; let actual = client diff --git a/eventstore/tests/common.rs b/eventstore/tests/common.rs index 81958967..45a5deba 100644 --- a/eventstore/tests/common.rs +++ b/eventstore/tests/common.rs @@ -15,7 +15,7 @@ pub fn generate_events>(event_type: Type, cnt: usize) -> Vec Result<()> { important_data: "clientOne".to_string(), }; - let event = EventData::json("some-event", data)?.id(Uuid::new_v4()); + let event = EventData::json("some-event", &data)?.id(Uuid::new_v4()); let options = AppendToStreamOptions::default().expected_revision(ExpectedRevision::Exact( last_event.get_original_event().revision, )); @@ -135,7 +135,7 @@ pub async fn append_overriding_user_credentials(client: &Client) -> Result<()> { important_data: "clientOne".to_string(), }; - let event = EventData::json("some-event", data)?.id(Uuid::new_v4()); + let event = EventData::json("some-event", &data)?.id(Uuid::new_v4()); // region overriding-user-credentials let options = diff --git a/examples/quickstart.rs b/examples/quickstart.rs index 67ae3036..ef4e063e 100644 --- a/examples/quickstart.rs +++ b/examples/quickstart.rs @@ -31,7 +31,7 @@ pub async fn run() -> Result<()> { important_data: "I wrote my first event!".to_string(), }; - let event_data = EventData::json("TestEvent", event)?.id(Uuid::new_v4()); + let event_data = EventData::json("TestEvent", &event)?.id(Uuid::new_v4()); // endregion createEvent let main_event_data = event_data.clone();