Struct quic_rpc::transport::quinn::QuinnServerEndpoint
source · pub struct QuinnServerEndpoint<S: Service> { /* private fields */ }
Expand description
A server endpoint using a quinn connection
Implementations§
source§impl<S: Service> QuinnServerEndpoint<S>
impl<S: Service> QuinnServerEndpoint<S>
sourcepub fn new(endpoint: Endpoint) -> Result<Self>
pub fn new(endpoint: Endpoint) -> Result<Self>
Create a new server channel, given a quinn endpoint.
The endpoint must be a server endpoint.
The server channel will take care of listening on the endpoint and spawning handlers for new connections.
sourcepub fn handle_connections(
incoming: Receiver<Connection>,
local_addr: SocketAddr,
) -> Self
pub fn handle_connections( incoming: Receiver<Connection>, local_addr: SocketAddr, ) -> Self
Create a new server channel, given just a source of incoming connections
This is useful if you want to manage the quinn endpoint yourself, use multiple endpoints, or use an endpoint for multiple protocols.
sourcepub fn handle_substreams(
receiver: Receiver<(SendStream, RecvStream)>,
local_addr: SocketAddr,
) -> Self
pub fn handle_substreams( receiver: Receiver<(SendStream, RecvStream)>, local_addr: SocketAddr, ) -> Self
Create a new server channel, given just a source of incoming substreams
This is useful if you want to manage the quinn endpoint yourself, use multiple endpoints, or use an endpoint for multiple protocols.
Trait Implementations§
source§impl<S: Service> BoxableServerEndpoint<<S as Service>::Req, <S as Service>::Res> for QuinnServerEndpoint<S>
impl<S: Service> BoxableServerEndpoint<<S as Service>::Req, <S as Service>::Res> for QuinnServerEndpoint<S>
source§fn clone_box(&self) -> Box<dyn BoxableServerEndpoint<S::Req, S::Res>>
fn clone_box(&self) -> Box<dyn BoxableServerEndpoint<S::Req, S::Res>>
Clone the server endpoint and box it
source§fn accept_bi_boxed(&self) -> AcceptFuture<'_, S::Req, S::Res> ⓘ
fn accept_bi_boxed(&self) -> AcceptFuture<'_, S::Req, S::Res> ⓘ
Accept a channel from a remote client
source§fn local_addr(&self) -> &[LocalAddr]
fn local_addr(&self) -> &[LocalAddr]
Get the local address
source§impl<S: Service> Clone for QuinnServerEndpoint<S>
impl<S: Service> Clone for QuinnServerEndpoint<S>
source§impl<S: Service> ConnectionCommon<<S as Service>::Req, <S as Service>::Res> for QuinnServerEndpoint<S>
impl<S: Service> ConnectionCommon<<S as Service>::Req, <S as Service>::Res> for QuinnServerEndpoint<S>
source§impl<S: Service> ConnectionErrors for QuinnServerEndpoint<S>
impl<S: Service> ConnectionErrors for QuinnServerEndpoint<S>
source§impl<S: Service> ServerEndpoint<<S as Service>::Req, <S as Service>::Res> for QuinnServerEndpoint<S>
impl<S: Service> ServerEndpoint<<S as Service>::Req, <S as Service>::Res> for QuinnServerEndpoint<S>
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.
source§fn local_addr(&self) -> &[LocalAddr]
fn local_addr(&self) -> &[LocalAddr]
The local addresses this endpoint is bound to.
Auto Trait Implementations§
impl<S> Freeze for QuinnServerEndpoint<S>
impl<S> !RefUnwindSafe for QuinnServerEndpoint<S>
impl<S> Send for QuinnServerEndpoint<S>
impl<S> Sync for QuinnServerEndpoint<S>
impl<S> Unpin for QuinnServerEndpoint<S>where
S: Unpin,
impl<S> !UnwindSafe for QuinnServerEndpoint<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§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
)