pub struct IrohRpcProtocolHandler { /* private fields */ }Expand description
Iroh protocol handler that terminates hyprstream-rpc/1 bidi streams,
dispatches each request through the wrapped IrohRequestProcessor,
caps concurrent streams server-wide (shared semaphore), and drains
in-flight requests
on ProtocolHandler::shutdown (called by Router::shutdown).
Implementations§
Source§impl IrohRpcProtocolHandler
impl IrohRpcProtocolHandler
Sourcepub fn new<P: IrohRequestProcessor>(
processor: P,
signing_key: SigningKey,
) -> Self
pub fn new<P: IrohRequestProcessor>( processor: P, signing_key: SigningKey, ) -> Self
Build a handler with the default server-wide stream limit
(DEFAULT_STREAM_LIMIT).
Sourcepub fn with_stream_limit(
processor: Arc<dyn IrohRequestProcessor>,
signing_key: SigningKey,
stream_limit: usize,
) -> Self
pub fn with_stream_limit( processor: Arc<dyn IrohRequestProcessor>, signing_key: SigningKey, stream_limit: usize, ) -> Self
Build a handler with an explicit server-wide stream limit.
Sourcepub fn with_read_timeout(self, read_timeout: Duration) -> Self
pub fn with_read_timeout(self, read_timeout: Duration) -> Self
Override the per-stream request-read timeout (#159). Primarily for
tests that need a short slowloris bound; production uses the default
super::rpc_session::REQUEST_READ_TIMEOUT.
Sourcepub fn with_connection_limit(self, connection_limit: usize) -> Self
pub fn with_connection_limit(self, connection_limit: usize) -> Self
Override the concurrent-connection cap (builder style, mirrors
super::quinn_transport::QuinnRpcServer::with_connection_limit).
Sourcepub fn with_rpc_config(self, cfg: &RpcConfig) -> Self
pub fn with_rpc_config(self, cfg: &RpcConfig) -> Self
Apply all tunables from an super::rpc_session::RpcConfig in one call (#197).
Trait Implementations§
Source§impl Clone for IrohRpcProtocolHandler
impl Clone for IrohRpcProtocolHandler
Source§fn clone(&self) -> IrohRpcProtocolHandler
fn clone(&self) -> IrohRpcProtocolHandler
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IrohRpcProtocolHandler
impl Debug for IrohRpcProtocolHandler
Auto Trait Implementations§
impl Freeze for IrohRpcProtocolHandler
impl !RefUnwindSafe for IrohRpcProtocolHandler
impl Send for IrohRpcProtocolHandler
impl Sync for IrohRpcProtocolHandler
impl Unpin for IrohRpcProtocolHandler
impl UnsafeUnpin for IrohRpcProtocolHandler
impl !UnwindSafe for IrohRpcProtocolHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<P> DynProtocolHandler for Pwhere
P: ProtocolHandler,
impl<P> DynProtocolHandler for Pwhere
P: ProtocolHandler,
§fn accept(
&self,
connection: Connection,
) -> Pin<Box<dyn Future<Output = Result<(), AcceptError>> + Send + '_>>
fn accept( &self, connection: Connection, ) -> Pin<Box<dyn Future<Output = Result<(), AcceptError>> + Send + '_>>
ProtocolHandler::accept].§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more