pub struct HyperServerEndpoint<In: RpcMessage, Out: RpcMessage> { /* private fields */ }
Expand description
A server endpoint 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> HyperServerEndpoint<In, Out>
impl<In: RpcMessage, Out: RpcMessage> HyperServerEndpoint<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 HyperServerEndpoint<In, Out>
impl<In: RpcMessage, Out: RpcMessage> Clone for HyperServerEndpoint<In, Out>
Source§impl<In: RpcMessage, Out: RpcMessage> ConnectionCommon<In, Out> for HyperServerEndpoint<In, Out>
impl<In: RpcMessage, Out: RpcMessage> ConnectionCommon<In, Out> for HyperServerEndpoint<In, Out>
Source§type RecvStream = RecvStream<In>
type RecvStream = RecvStream<In>
Receive side of a bidirectional typed channel
Source§impl<In: RpcMessage, Out: RpcMessage> ConnectionErrors for HyperServerEndpoint<In, Out>
impl<In: RpcMessage, Out: RpcMessage> ConnectionErrors for HyperServerEndpoint<In, Out>
Source§impl<In: Debug + RpcMessage, Out: Debug + RpcMessage> Debug for HyperServerEndpoint<In, Out>
impl<In: Debug + RpcMessage, Out: Debug + RpcMessage> Debug for HyperServerEndpoint<In, Out>
Source§impl<In: RpcMessage, Out: RpcMessage> ServerEndpoint<In, Out> for HyperServerEndpoint<In, Out>
impl<In: RpcMessage, Out: RpcMessage> ServerEndpoint<In, Out> for HyperServerEndpoint<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), AcceptBiError>
async fn accept( &self, ) -> Result<(Self::SendSink, Self::RecvStream), AcceptBiError>
Accept a new typed bidirectional channel on any of the connections we
have currently opened.
Auto Trait Implementations§
impl<In, Out> Freeze for HyperServerEndpoint<In, Out>
impl<In, Out> !RefUnwindSafe for HyperServerEndpoint<In, Out>
impl<In, Out> Send for HyperServerEndpoint<In, Out>
impl<In, Out> Sync for HyperServerEndpoint<In, Out>
impl<In, Out> Unpin for HyperServerEndpoint<In, Out>
impl<In, Out> !UnwindSafe for HyperServerEndpoint<In, Out>
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)