pub struct QuinnServerEndpoint<In: RpcMessage, Out: RpcMessage> { /* private fields */ }
Expand description
A server endpoint using a quinn connection
Implementations§
Source§impl<In: RpcMessage, Out: RpcMessage> QuinnServerEndpoint<In, Out>
impl<In: RpcMessage, Out: RpcMessage> QuinnServerEndpoint<In, Out>
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<In: RpcMessage, Out: RpcMessage> BoxableServerEndpoint<In, Out> for QuinnServerEndpoint<In, Out>
impl<In: RpcMessage, Out: RpcMessage> BoxableServerEndpoint<In, Out> for QuinnServerEndpoint<In, Out>
Source§fn clone_box(&self) -> Box<dyn BoxableServerEndpoint<In, Out>>
fn clone_box(&self) -> Box<dyn BoxableServerEndpoint<In, Out>>
Clone the server endpoint and box it
Source§fn accept_bi_boxed(&self) -> AcceptFuture<'_, In, Out> ⓘ
fn accept_bi_boxed(&self) -> AcceptFuture<'_, In, Out> ⓘ
Accept a channel from a remote client
Source§fn local_addr(&self) -> &[LocalAddr]
fn local_addr(&self) -> &[LocalAddr]
Get the local address
Source§impl<In: RpcMessage, Out: RpcMessage> Clone for QuinnServerEndpoint<In, Out>
impl<In: RpcMessage, Out: RpcMessage> Clone for QuinnServerEndpoint<In, Out>
Source§impl<In: RpcMessage, Out: RpcMessage> ConnectionCommon<In, Out> for QuinnServerEndpoint<In, Out>
impl<In: RpcMessage, Out: RpcMessage> ConnectionCommon<In, Out> for QuinnServerEndpoint<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 QuinnServerEndpoint<In, Out>
impl<In: RpcMessage, Out: RpcMessage> ConnectionErrors for QuinnServerEndpoint<In, Out>
Source§impl<In: Debug + RpcMessage, Out: Debug + RpcMessage> Debug for QuinnServerEndpoint<In, Out>
impl<In: Debug + RpcMessage, Out: Debug + RpcMessage> Debug for QuinnServerEndpoint<In, Out>
Source§impl<In: RpcMessage, Out: RpcMessage> ServerEndpoint<In, Out> for QuinnServerEndpoint<In, Out>
impl<In: RpcMessage, Out: RpcMessage> ServerEndpoint<In, Out> for QuinnServerEndpoint<In, Out>
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<In, Out> Freeze for QuinnServerEndpoint<In, Out>
impl<In, Out> !RefUnwindSafe for QuinnServerEndpoint<In, Out>
impl<In, Out> Send for QuinnServerEndpoint<In, Out>
impl<In, Out> Sync for QuinnServerEndpoint<In, Out>
impl<In, Out> Unpin for QuinnServerEndpoint<In, Out>
impl<In, Out> !UnwindSafe for QuinnServerEndpoint<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
)