Struct quic_rpc::transport::hyper::HyperServerEndpoint
source · pub struct HyperServerEndpoint<S: Service> { /* 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<S: Service> HyperServerEndpoint<S>
impl<S: Service> HyperServerEndpoint<S>
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<S: Service> Clone for HyperServerEndpoint<S>
impl<S: Service> Clone for HyperServerEndpoint<S>
source§impl<S: Service> ConnectionCommon<<S as Service>::Req, <S as Service>::Res> for HyperServerEndpoint<S>
impl<S: Service> ConnectionCommon<<S as Service>::Req, <S as Service>::Res> for HyperServerEndpoint<S>
§type RecvStream = RecvStream<<S as Service>::Req>
type RecvStream = RecvStream<<S as Service>::Req>
Receive side of a bidirectional typed channel
source§impl<S: Service> ConnectionErrors for HyperServerEndpoint<S>
impl<S: Service> ConnectionErrors for HyperServerEndpoint<S>
source§impl<S: Service> ServerEndpoint<<S as Service>::Req, <S as Service>::Res> for HyperServerEndpoint<S>
impl<S: Service> ServerEndpoint<<S as Service>::Req, <S as Service>::Res> for HyperServerEndpoint<S>
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<S> Freeze for HyperServerEndpoint<S>
impl<S> !RefUnwindSafe for HyperServerEndpoint<S>
impl<S> Send for HyperServerEndpoint<S>
impl<S> Sync for HyperServerEndpoint<S>
impl<S> Unpin for HyperServerEndpoint<S>where
S: Unpin,
impl<S> !UnwindSafe for HyperServerEndpoint<S>
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)