scatter_net/scatter_net/net/implementations/
protocol_handler.rs

1use iroh::protocol::{AcceptError, ProtocolHandler};
2
3use crate::ScatterNet;
4
5impl ProtocolHandler for ScatterNet {
6    async fn accept(
7        &self,
8        connection: iroh::endpoint::Connection,
9    ) -> Result<(), iroh::protocol::AcceptError> {
10        self.accept_connection(connection)
11            .map_err(AcceptError::from_err)
12            .and(Ok(()))
13    }
14}