Skip to content

Commit 2b55b7b

Browse files
committed
rename rpc feature
1 parent 7567a66 commit 2b55b7b

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

Diff for: Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ smallvec = { version = "1.14.0", features = ["write"] }
3030
quic-rpc-derive = { path = "quic-rpc-derive" }
3131

3232
[features]
33-
quinn = ["dep:quinn", "dep:postcard"]
34-
default = ["quinn", "test"]
33+
rpc = ["dep:quinn", "dep:postcard"]
34+
default = ["rpc", "test"]
3535
test = ["rustls", "rcgen"]
3636

3737
[workspace]

Diff for: examples/derive.rs

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ impl StorageActor {
100100
}
101101
}
102102
}
103+
103104
struct StorageApi {
104105
inner: ServiceSender<StorageMessage, StorageProtocol, StorageService>,
105106
}

Diff for: src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ impl<I: Channels<S>, S: Service> Deref for WithChannels<I, S> {
328328

329329
pub enum ServiceSender<M, R, S> {
330330
Local(LocalMpscChannel<M, S>, PhantomData<R>),
331-
#[cfg(feature = "quinn")]
331+
#[cfg(feature = "rpc")]
332332
Remote(quinn::Endpoint, SocketAddr, PhantomData<(R, S)>),
333333
}
334334

@@ -342,7 +342,7 @@ impl<M: Send + Sync + 'static, R, S: Service> ServiceSender<M, R, S> {
342342
pub async fn request(&self) -> anyhow::Result<ServiceRequest<M, R, S>> {
343343
match self {
344344
Self::Local(tx, _) => Ok(ServiceRequest::from(tx.clone())),
345-
#[cfg(feature = "quinn")]
345+
#[cfg(feature = "rpc")]
346346
Self::Remote(endpoint, addr, _) => {
347347
let connection = endpoint.connect(*addr, "localhost")?.await?;
348348
let (send, recv) = connection.open_bi().await?;
@@ -367,7 +367,7 @@ impl<M, S> Clone for LocalMpscChannel<M, S> {
367367
}
368368
}
369369

370-
#[cfg(feature = "quinn")]
370+
#[cfg(feature = "rpc")]
371371
pub mod rpc {
372372
use std::{fmt::Debug, future::Future, io, marker::PhantomData, pin::Pin, sync::Arc};
373373

@@ -589,7 +589,7 @@ pub mod rpc {
589589
#[derive(Debug)]
590590
pub enum ServiceRequest<M, R, S> {
591591
Local(LocalMpscChannel<M, S>, PhantomData<R>),
592-
#[cfg(feature = "quinn")]
592+
#[cfg(feature = "rpc")]
593593
Remote(rpc::RemoteRequest<R, S>),
594594
}
595595

Diff for: src/util.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[cfg(feature = "test")]
1+
#[cfg(all(feature = "rpc", feature = "test"))]
22
mod quinn_setup_utils {
33
use std::{net::SocketAddr, sync::Arc};
44

@@ -138,10 +138,10 @@ mod quinn_setup_utils {
138138
}
139139
}
140140
}
141-
#[cfg(feature = "test")]
141+
#[cfg(all(feature = "rpc", feature = "test"))]
142142
pub use quinn_setup_utils::*;
143143

144-
#[cfg(feature = "quinn")]
144+
#[cfg(feature = "rpc")]
145145
mod varint_util {
146146
use std::{
147147
future::Future,
@@ -341,7 +341,7 @@ mod varint_util {
341341
}
342342
}
343343
}
344-
#[cfg(feature = "quinn")]
344+
#[cfg(feature = "rpc")]
345345
pub use varint_util::{
346346
read_varint_u64, write_varint_u64, AsyncReadVarintExt, AsyncWriteVarintExt, WriteVarintExt,
347347
};

0 commit comments

Comments
 (0)