Struct quic_rpc::transport::http2::ServerChannel
source · pub struct ServerChannel<In: RpcMessage, Out: RpcMessage> { /* private fields */ }
Expand description
A server-side channel using a hyper connection
Each request made by the any client connection this channel will yield a (recv, send)
pair which allows receiving the request and sending the response. Both these are
channels themselves to support streaming requests and responses.
Creating this spawns a tokio task which runs the server, once dropped this task is shut down: no new connections will be accepted and existing channels will stop.
Implementations§
source§impl<In: RpcMessage, Out: RpcMessage> ServerChannel<In, Out>
impl<In: RpcMessage, Out: RpcMessage> ServerChannel<In, Out>
sourcepub fn serve(addr: &SocketAddr) -> Result<Self>
pub fn serve(addr: &SocketAddr) -> Result<Self>
Creates a server listening on the SocketAddr
, with the default configuration.
sourcepub fn serve_with_config(
addr: &SocketAddr,
config: ChannelConfig
) -> Result<Self>
pub fn serve_with_config(
addr: &SocketAddr,
config: ChannelConfig
) -> Result<Self>
Creates a server listening on the SocketAddr
with a custom configuration.
Trait Implementations§
source§impl<In: RpcMessage, Out: RpcMessage> Clone for ServerChannel<In, Out>
impl<In: RpcMessage, Out: RpcMessage> Clone for ServerChannel<In, Out>
source§impl<In: Debug + RpcMessage, Out: Debug + RpcMessage> Debug for ServerChannel<In, Out>
impl<In: Debug + RpcMessage, Out: Debug + RpcMessage> Debug for ServerChannel<In, Out>
source§impl<In: RpcMessage, Out: RpcMessage> ServerChannel<In, Out, ChannelTypes> for ServerChannel<In, Out>
impl<In: RpcMessage, Out: RpcMessage> ServerChannel<In, Out, ChannelTypes> for ServerChannel<In, Out>
source§fn accept_bi(&self) -> AcceptBiFuture<'_, In, Out> ⓘ
fn accept_bi(&self) -> AcceptBiFuture<'_, In, Out> ⓘ
Accept a bidirectional stream
source§fn local_addr(&self) -> &[LocalAddr]
fn local_addr(&self) -> &[LocalAddr]
The local addresses this server is bound to. Read more