pub struct HyperListener<In: RpcMessage, Out: RpcMessage> { /* private fields */ }
Expand description
A listener using a hyper server
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> HyperListener<In, Out>
impl<In: RpcMessage, Out: RpcMessage> HyperListener<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 HyperListener<In, Out>
impl<In: RpcMessage, Out: RpcMessage> Clone for HyperListener<In, Out>
Source§impl<In: RpcMessage, Out: RpcMessage> ConnectionErrors for HyperListener<In, Out>
impl<In: RpcMessage, Out: RpcMessage> ConnectionErrors for HyperListener<In, Out>
Source§impl<In: Debug + RpcMessage, Out: Debug + RpcMessage> Debug for HyperListener<In, Out>
impl<In: Debug + RpcMessage, Out: Debug + RpcMessage> Debug for HyperListener<In, Out>
Source§impl<In: RpcMessage, Out: RpcMessage> Listener for HyperListener<In, Out>
impl<In: RpcMessage, Out: RpcMessage> Listener for HyperListener<In, Out>
Source§fn local_addr(&self) -> &[LocalAddr]
fn local_addr(&self) -> &[LocalAddr]
The local addresses this endpoint is bound to.
Source§async fn accept(
&self,
) -> Result<(Self::SendSink, Self::RecvStream), AcceptError>
async fn accept( &self, ) -> Result<(Self::SendSink, Self::RecvStream), AcceptError>
Accept a new typed bidirectional channel on any of the connections we
have currently opened.
Source§impl<In: RpcMessage, Out: RpcMessage> StreamTypes for HyperListener<In, Out>
impl<In: RpcMessage, Out: RpcMessage> StreamTypes for HyperListener<In, Out>
Source§type RecvStream = RecvStream<In>
type RecvStream = RecvStream<In>
Receive side of a bidirectional typed channel
Auto Trait Implementations§
impl<In, Out> Freeze for HyperListener<In, Out>
impl<In, Out> RefUnwindSafe for HyperListener<In, Out>where
In: RefUnwindSafe,
Out: RefUnwindSafe,
impl<In, Out> Send for HyperListener<In, Out>
impl<In, Out> Sync for HyperListener<In, Out>
impl<In, Out> Unpin for HyperListener<In, Out>
impl<In, Out> UnwindSafe for HyperListener<In, Out>where
In: UnwindSafe,
Out: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Mutably borrows from an owned value. Read more