Struct trust_dns_proto::quic::QuicServer
source · [−]pub struct QuicServer { /* private fields */ }
dns-over-quic
and tokio-runtime
only.Expand description
A DNS-over-QUIC Server, see QuicClientStream for the client counterpart
Implementations
sourceimpl 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more