Struct hickory_proto::h3::h3_server::H3Server
source · pub struct H3Server { /* private fields */ }
Available on crate feature
dns-over-h3
only.Expand description
A DNS-over-HTTP/3 Server, see H3ClientStream for the client counterpart
Implementations§
source§impl H3Server
impl H3Server
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 accept(
&mut self
) -> Result<Option<(H3Connection, SocketAddr)>, ProtoError>
pub async fn accept( &mut self ) -> Result<Option<(H3Connection, SocketAddr)>, ProtoError>
Accept the next incoming connection.
§Returns
A remote connection that could accept many potential requests 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 H3Server
impl !RefUnwindSafe for H3Server
impl Send for H3Server
impl Sync for H3Server
impl Unpin for H3Server
impl !UnwindSafe for H3Server
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