pub struct QuicServer { /* private fields */ }
Available on crate features
dns-over-quic
and tokio-runtime
only.Expand description
A DNS-over-QUIC Server, see QuicClientStream for the client counterpart
Implementations§
Source§impl QuicServer
impl QuicServer
Sourcepub async fn new(
name_server: SocketAddr,
cert: Vec<CertificateDer<'static>>,
key: PrivateKeyDer<'static>,
) -> Result<Self, ProtoError>
pub async fn new( name_server: SocketAddr, cert: Vec<CertificateDer<'static>>, key: PrivateKeyDer<'static>, ) -> Result<Self, ProtoError>
Construct the new Acceptor with the associated pkcs12 data
Sourcepub fn with_socket(
socket: UdpSocket,
cert: Vec<CertificateDer<'static>>,
key: PrivateKeyDer<'static>,
) -> Result<Self, ProtoError>
pub fn with_socket( socket: UdpSocket, cert: Vec<CertificateDer<'static>>, key: PrivateKeyDer<'static>, ) -> Result<Self, ProtoError>
Construct the new server with an existing socket
Sourcepub async fn next(
&mut self,
) -> Result<Option<(QuicStreams, SocketAddr)>, ProtoError>
pub async fn next( &mut self, ) -> Result<Option<(QuicStreams, SocketAddr)>, ProtoError>
Get the next incoming stream
§Returns
A remote connection that could have many potential bi-directional streams and the remote socket address
Sourcepub fn local_addr(&self) -> Result<SocketAddr, Error>
pub fn local_addr(&self) -> Result<SocketAddr, Error>
Returns the address this server is listening on
This can be useful in tests, where a random port can be associated with the server by binding on 127.0.0.1:0
and then getting the
associated port address with this function.
Auto Trait Implementations§
impl Freeze for QuicServer
impl !RefUnwindSafe for QuicServer
impl Send for QuicServer
impl Sync for QuicServer
impl Unpin for QuicServer
impl !UnwindSafe for QuicServer
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