Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,17 @@ members = ["irpc-derive", "irpc-iroh"]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "quicrpc_docsrs"]
rustdoc-args = ["--cfg", "irpc_docsrs"]

[package.metadata.release]
pre-release-hook = ["git", "cliff", "--unreleased", "--tag", "{{version}}", "--prepend", "CHANGELOG.md"]

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(quicrpc_docsrs)"] }
# Documents which cargo features an API needs. Preview locally with:
# RUSTDOCFLAGS="--cfg irpc_docsrs" cargo +nightly doc --all-features.
# We use our own irpc_docsrs rather than the common docsrs so the cfg
# does not leak into dependencies, some of which fail to build under it.
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(irpc_docsrs)"] }

[workspace.dependencies]
anyhow = { version = "1" }
Expand Down
11 changes: 1 addition & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
//! framework for any transport with cheap streams such as QUIC. Compared to
//! quic-rpc, this crate does not abstract over the stream type and is focused
//! on [iroh](https://docs.rs/iroh/latest/iroh/index.html) and our [noq](https://docs.rs/noq/latest/noq/index.html).
#![cfg_attr(quicrpc_docsrs, feature(doc_cfg))]
#![cfg_attr(irpc_docsrs, feature(doc_cfg))]
use std::{fmt::Debug, future::Future, io, marker::PhantomData, ops::Deref};

/// Processes an RPC request enum and generates trait implementations for use with `irpc`.
Expand Down Expand Up @@ -301,7 +301,6 @@ use std::{fmt::Debug, future::Future, io, marker::PhantomData, ops::Deref};
/// [`WithChannels<T, Service>`]: WithChannels
/// [`Channels<S>`]: Channels
#[cfg(feature = "derive")]
#[cfg_attr(quicrpc_docsrs, doc(cfg(feature = "derive")))]
pub use irpc_derive::rpc_requests;
#[cfg(feature = "rpc")]
use n0_error::AnyError;
Expand All @@ -320,7 +319,6 @@ use crate::channel::SendError;

pub mod channel;
#[cfg(feature = "rpc")]
#[cfg_attr(quicrpc_docsrs, doc(cfg(feature = "rpc")))]
pub mod span_propagation;
#[cfg(test)]
mod tests;
Expand All @@ -330,7 +328,6 @@ pub mod rpc {
pub struct RemoteSender<S>(std::marker::PhantomData<S>);
}
#[cfg(feature = "rpc")]
#[cfg_attr(quicrpc_docsrs, doc(cfg(feature = "rpc")))]
pub mod rpc;

mod sealed {
Expand Down Expand Up @@ -409,7 +406,6 @@ pub struct WithChannels<I: Channels<S>, S: Service> {
pub rx: <I as Channels<S>>::Rx,
/// The current span where the full message was created.
#[cfg(feature = "spans")]
#[cfg_attr(quicrpc_docsrs, doc(cfg(feature = "spans")))]
pub span: tracing::Span,
}

Expand Down Expand Up @@ -873,10 +869,8 @@ impl<S: Service> Client<S> {
pub(crate) enum ClientInner<M> {
Local(crate::channel::mpsc::Sender<M>),
#[cfg(feature = "rpc")]
#[cfg_attr(quicrpc_docsrs, doc(cfg(feature = "rpc")))]
Remote(Box<dyn rpc::RemoteConnection>),
#[cfg(not(feature = "rpc"))]
#[cfg_attr(quicrpc_docsrs, doc(cfg(feature = "rpc")))]
#[allow(dead_code)]
Remote(PhantomData<M>),
}
Expand Down Expand Up @@ -912,23 +906,20 @@ impl<M> ClientInner<M> {
pub enum RequestError {
/// Error in noq during connect
#[cfg(feature = "rpc")]
#[cfg_attr(quicrpc_docsrs, doc(cfg(feature = "rpc")))]
#[error("Error establishing connection")]
Connect {
#[error(std_err)]
source: noq::ConnectError,
},
/// Error in noq when the connection already exists, when opening a stream pair
#[cfg(feature = "rpc")]
#[cfg_attr(quicrpc_docsrs, doc(cfg(feature = "rpc")))]
#[error("Error opening stream")]
Connection {
#[error(std_err)]
source: noq::ConnectionError,
},
/// Generic error for non-noq transports
#[cfg(feature = "rpc")]
#[cfg_attr(quicrpc_docsrs, doc(cfg(feature = "rpc")))]
#[error("Error opening stream")]
Other { source: AnyError },

Expand Down
10 changes: 0 additions & 10 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//! This module contains utilities to read and write varints, as well as
//! functions to set up noq endpoints for local rpc and testing.
#[cfg(feature = "noq_endpoint_setup")]
#[cfg_attr(quicrpc_docsrs, doc(cfg(feature = "noq_endpoint_setup")))]
mod noq_setup_utils {
use std::{sync::Arc, time::Duration};

Expand Down Expand Up @@ -175,14 +174,9 @@ mod noq_setup_utils {
}
}
#[cfg(feature = "noq_endpoint_setup")]
#[cfg_attr(quicrpc_docsrs, doc(cfg(feature = "noq_endpoint_setup")))]
pub use noq_setup_utils::*;

#[cfg(any(feature = "rpc", feature = "varint-util"))]
#[cfg_attr(
quicrpc_docsrs,
doc(cfg(any(feature = "rpc", feature = "varint-util")))
)]
mod varint_util {
use std::{
future::Future,
Expand Down Expand Up @@ -392,10 +386,6 @@ mod varint_util {
}

#[cfg(any(feature = "rpc", feature = "varint-util"))]
#[cfg_attr(
quicrpc_docsrs,
doc(cfg(any(feature = "rpc", feature = "varint-util")))
)]
pub use varint_util::{AsyncReadVarintExt, AsyncWriteVarintExt, WriteVarintExt};

mod fuse_wrapper {
Expand Down
Loading