Struct trust_dns_proto::quic::QuicServer
source · 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<Certificate>,
key: PrivateKey
) -> Result<Self, ProtoError>
pub async fn new( name_server: SocketAddr, cert: Vec<Certificate>, key: PrivateKey ) -> Result<Self, ProtoError>
Construct the new Acceptor with the associated pkcs12 data
sourcepub fn with_socket(
socket: UdpSocket,
cert: Vec<Certificate>,
key: PrivateKey
) -> Result<Self, ProtoError>
pub fn with_socket( socket: UdpSocket, cert: Vec<Certificate>, key: PrivateKey ) -> 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 !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