Skip to content

Commit

Permalink
fixup docs
Browse files Browse the repository at this point in the history
  • Loading branch information
flub committed May 10, 2024
1 parent 1d2686c commit 5652f3f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
13 changes: 9 additions & 4 deletions iroh-blobs/src/get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ pub mod fsm {
/// The serialized request is too long to be sent
#[error("request too big")]
RequestTooBig,
/// Error when writing the request to the [`quinn::SendStream`]
/// Error when writing the request to the [`SendStream`].
///
/// [`SendStream`]: iroh_net::magic_endpoint::SendStream
#[error("write: {0}")]
Write(#[from] iroh_net::magic_endpoint::WriteError),
/// A generic io error
Expand Down Expand Up @@ -528,8 +530,8 @@ pub mod fsm {
/// decoding the response, e.g. from [`AtBlobContent::next`].
///
/// This is similar to [`bao_tree::io::DecodeError`], but takes into account
/// that we are reading from a [`quinn::RecvStream`], so read errors will be
/// propagated as [`DecodeError::Read`], containing a [`quinn::ReadError`].
/// that we are reading from a [`RecvStream`], so read errors will be
/// propagated as [`DecodeError::Read`], containing a [`ReadError`].
/// This carries more concrete information about the error than an [`io::Error`].
///
/// When the provider finds that it does not have a chunk that we requested,
Expand All @@ -544,7 +546,10 @@ pub mod fsm {
/// not behaving correctly.
///
/// The [`DecodeError::Io`] variant is just a fallback for any other io error that
/// is not actually a [`quinn::ReadError`].
/// is not actually a [`ReadError`].
///
/// [`RecvStream`]: iroh_net::magic_endpoint::RecvStream
/// [`ReadError`]: iroh_net::magic_endpoint::ReadError
#[derive(Debug, thiserror::Error)]
pub enum DecodeError {
/// A chunk was not found or invalid, so the provider stopped sending data
Expand Down
9 changes: 6 additions & 3 deletions iroh-blobs/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,14 @@ impl GetRequest {
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[repr(u16)]
pub enum Closed {
/// The [`quinn::RecvStream`] was dropped.
/// The [`RecvStream`] was dropped.
///
/// Used implicitly when a [`quinn::RecvStream`] is dropped without explicit call to
/// [`quinn::RecvStream::stop`]. We don't use this explicitly but this is here as
/// Used implicitly when a [`RecvStream`] is dropped without explicit call to
/// [`RecvStream::stop`]. We don't use this explicitly but this is here as
/// documentation as to what happened to `0`.
///
/// [`RecvStream`]: iroh_net::magic_endpoint::RecvStream
/// [`RecvStream::stop`]: iroh_net::magic_endpoint::RecvStream::stop
StreamDropped = 0,
/// The provider is terminating.
///
Expand Down
4 changes: 3 additions & 1 deletion iroh-gossip/src/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,11 @@ impl Gossip {
}
}

/// Handle an incoming [`quinn::Connection`].
/// Handle an incoming [`Connection`].
///
/// Make sure to check the ALPN protocol yourself before passing the connection.
///
/// [`Connection`]: iroh_net::magic_endpoint::Connection
pub async fn handle_connection(
&self,
conn: iroh_net::magic_endpoint::Connection,
Expand Down

0 comments on commit 5652f3f

Please sign in to comment.