Skip to content

Commit

Permalink
Merge pull request #277 from c410-f3r/misc
Browse files Browse the repository at this point in the history
wtx-0.25.0
  • Loading branch information
c410-f3r authored Nov 26, 2024
2 parents 71e3554 + 8f04924 commit 0378eff
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .scripts/internal-tests-0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ $rt test-with-features wtx fastrand
$rt test-with-features wtx flate2
$rt test-with-features wtx foldhash
$rt test-with-features wtx grpc
$rt test-with-features wtx grpc-client
$rt test-with-features wtx grpc-server
$rt test-with-features wtx hashbrown
$rt test-with-features wtx hmac
$rt test-with-features wtx http-client-framework
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

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

4 changes: 2 additions & 2 deletions wtx-instances/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ required-features = ["wtx/client-api-framework", "wtx/http-client-framework", "w
[[example]]
name = "grpc-client"
path = "generic-examples/grpc-client.rs"
required-features = ["grpc"]
required-features = ["grpc-client"]

[[example]]
name = "grpc-server"
path = "generic-examples/grpc-server.rs"
required-features = ["grpc", "wtx/tokio-rustls"]
required-features = ["grpc-server", "wtx/tokio-rustls"]

[[example]]
name = "http-client-framework"
Expand Down
8 changes: 5 additions & 3 deletions wtx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,16 @@ executor = []
fastrand = ["dep:fastrand"]
flate2 = ["dep:flate2"]
foldhash = ["dep:foldhash", "hashbrown?/default-hasher"]
grpc = ["data-transformation", "http-client-framework", "http-server-framework"]
grpc = ["data-transformation"]
grpc-client = ["grpc", "http-client-framework"]
grpc-server = ["grpc", "http-server-framework"]
hashbrown = ["dep:hashbrown"]
hmac = ["dep:hmac"]
http = []
http-client-framework = ["http2", "pool", "std"]
http-cookie = ["chrono/alloc", "http"]
http-cookie-secure = ["aes-gcm/aes", "aes-gcm/alloc", "base64", "digest", "http-cookie"]
http-server-framework = ["http2", "tokio"]
http-server-framework = ["http2"]
http-session = ["chrono/serde", "http-cookie-secure", "serde_json"]
http2 = ["foldhash", "hashbrown", "http"]
httparse = ["dep:httparse"]
Expand Down Expand Up @@ -151,7 +153,7 @@ name = "wtx"
readme = "README.md"
repository = "https://github.com/c410-f3r/wtx"
rust-version = "1.82"
version = "0.24.0"
version = "0.25.0"

[package.metadata.docs.rs]
all-features = true
4 changes: 4 additions & 0 deletions wtx/src/grpc.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
//! gRPC (gRPC Remote Procedure Calls) is a high performance remote procedure call (RPC)
//! framework.
#[cfg(feature = "grpc-client")]
mod client;
mod grpc_manager;
#[cfg(feature = "grpc-server")]
mod grpc_middleware;
mod grpc_status_code;

use crate::{data_transformation::dnsn::Serialize, misc::Vector};
#[cfg(feature = "grpc-client")]
pub use client::Client;
pub use grpc_manager::GrpcManager;
#[cfg(feature = "grpc-server")]
pub use grpc_middleware::GrpcMiddleware;
pub use grpc_status_code::GrpcStatusCode;

Expand Down
4 changes: 2 additions & 2 deletions wtx/src/grpc/grpc_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use crate::{
format::{VerbatimRequest, VerbatimResponse},
},
grpc::{serialize, GrpcStatusCode},
http::server_framework::StreamAux,
misc::Vector,
};

Expand Down Expand Up @@ -50,7 +49,8 @@ impl<DRSR> GrpcManager<DRSR> {
}
}

impl<DRSR> StreamAux for GrpcManager<DRSR>
#[cfg(feature = "grpc-server")]
impl<DRSR> crate::http::server_framework::StreamAux for GrpcManager<DRSR>
where
DRSR: Default,
{
Expand Down
2 changes: 1 addition & 1 deletion wtx/src/grpc/grpc_middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ where
is_sensitive: false,
is_trailer: true,
name: "grpc-status",
value: [stream_aux.status_code_mut().number_as_str().as_bytes()].into_iter(),
value: [stream_aux.status_code_mut()._number_as_str().as_bytes()].into_iter(),
},
])?;
Ok(ControlFlow::Continue(()))
Expand Down
2 changes: 1 addition & 1 deletion wtx/src/grpc/grpc_status_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub enum GrpcStatusCode {

impl GrpcStatusCode {
#[inline]
pub(crate) fn number_as_str(self) -> &'static str {
pub(crate) fn _number_as_str(self) -> &'static str {
match self {
GrpcStatusCode::Ok => "0",
GrpcStatusCode::Cancelled => "1",
Expand Down
2 changes: 1 addition & 1 deletion wtx/src/http/optioned_server/http2_tokio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ impl OptionedServer {
+ Send
+ 'static,
A::Future: Send,
CA: Clone + Send + 'static,
ACPT: Send + 'static,
CA: Clone + Send + 'static,
E: From<crate::Error> + Send + 'static,
HA: Send + 'static,
M: Clone
Expand Down

0 comments on commit 0378eff

Please sign in to comment.