Skip to content

Commit 983db0a

Browse files
committed
docs: add docs
1 parent 9acf53d commit 983db0a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

irpc-iroh/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ use tracing::{trace, trace_span, warn, Instrument};
101101
#[cfg(all(target_family = "wasm", target_os = "unknown"))]
102102
use wasm_browser::*;
103103

104+
/// A [`ProtocolHandler`] for an irpc protocol.
105+
///
106+
/// Can be added to an [`iroh::router::Router`] to handle incoming connections for an ALPN string.
104107
pub struct IrohProtocol<R> {
105108
handler: Handler<R>,
106109
request_id: AtomicU64,
@@ -133,6 +136,7 @@ impl<R: DeserializeOwned + Send + 'static> ProtocolHandler for IrohProtocol<R> {
133136
}
134137
}
135138

139+
/// Handles a single iroh connection with the provided `handler`.
136140
pub async fn handle_connection<R: DeserializeOwned + 'static>(
137141
connection: Connection,
138142
handler: Handler<R>,

0 commit comments

Comments
 (0)