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> 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>
§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 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_bi(
&self
) -> Result<(Self::SendSink, Self::RecvStream), AcceptBiError>
async fn accept_bi( &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