pub struct QuinnListener<In: RpcMessage, Out: RpcMessage> { /* private fields */ }
Expand description
A listener using a quinn connection
Implementations§
Source§impl<In: RpcMessage, Out: RpcMessage> QuinnListener<In, Out>
impl<In: RpcMessage, Out: RpcMessage> QuinnListener<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> BoxableListener<In, Out> for QuinnListener<In, Out>
impl<In: RpcMessage, Out: RpcMessage> BoxableListener<In, Out> for QuinnListener<In, Out>
Source§fn clone_box(&self) -> Box<dyn BoxableListener<In, Out>>
fn clone_box(&self) -> Box<dyn BoxableListener<In, Out>>
Clone the listener 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 QuinnListener<In, Out>
impl<In: RpcMessage, Out: RpcMessage> Clone for QuinnListener<In, Out>
Source§impl<In: RpcMessage, Out: RpcMessage> ConnectionErrors for QuinnListener<In, Out>
impl<In: RpcMessage, Out: RpcMessage> ConnectionErrors for QuinnListener<In, Out>
Source§impl<In: Debug + RpcMessage, Out: Debug + RpcMessage> Debug for QuinnListener<In, Out>
impl<In: Debug + RpcMessage, Out: Debug + RpcMessage> Debug for QuinnListener<In, Out>
Source§impl<In: RpcMessage, Out: RpcMessage> Listener for QuinnListener<In, Out>
impl<In: RpcMessage, Out: RpcMessage> Listener for QuinnListener<In, Out>
Source§async fn accept(
&self,
) -> Result<(Self::SendSink, Self::RecvStream), AcceptError>
async fn accept( &self, ) -> Result<(Self::SendSink, Self::RecvStream), AcceptError>
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.
Source§impl<In: RpcMessage, Out: RpcMessage> StreamTypes for QuinnListener<In, Out>
impl<In: RpcMessage, Out: RpcMessage> StreamTypes for QuinnListener<In, Out>
Source§type RecvStream = RecvStream<In>
type RecvStream = RecvStream<In>
Receive side of a bidirectional typed channel
Auto Trait Implementations§
impl<In, Out> Freeze for QuinnListener<In, Out>
impl<In, Out> !RefUnwindSafe for QuinnListener<In, Out>
impl<In, Out> Send for QuinnListener<In, Out>
impl<In, Out> Sync for QuinnListener<In, Out>
impl<In, Out> Unpin for QuinnListener<In, Out>
impl<In, Out> !UnwindSafe for QuinnListener<In, Out>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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