[][src]Struct trust_dns_server::ServerFuture

pub struct ServerFuture<T: RequestHandler> { /* fields omitted */ }

A Futures based implementation of a DNS server

Methods

impl<T: RequestHandler> ServerFuture<T>[src]

pub fn new(handler: T) -> ServerFuture<T>[src]

Creates a new ServerFuture with the specified Handler.

pub fn register_socket(&mut self, socket: UdpSocket, runtime: &Runtime)[src]

Register a UDP socket. Should be bound before calling this function.

pub fn register_socket_std(&mut self, socket: UdpSocket, runtime: &Runtime)[src]

Register a UDP socket. Should be bound before calling this function.

pub fn register_listener(
    &mut self,
    listener: TcpListener,
    timeout: Duration,
    runtime: &Runtime
) -> Result<()>
[src]

Register a TcpListener to the Server. This should already be bound to either an IPv6 or an IPv4 address.

To make the server more resilient to DOS issues, there is a timeout. Care should be taken to not make this too low depending on use cases.

Arguments

  • listener - a bound TCP socket
  • timeout - timeout duration of incoming requests, any connection that does not send requests within this time period will be closed. In the future it should be possible to create long-lived queries, but these should be from trusted sources only, this would require some type of whitelisting.

pub fn register_listener_std(
    &mut self,
    listener: TcpListener,
    timeout: Duration,
    runtime: &Runtime
) -> Result<()>
[src]

Register a TcpListener to the Server. This should already be bound to either an IPv6 or an IPv4 address.

To make the server more resilient to DOS issues, there is a timeout. Care should be taken to not make this too low depending on use cases.

Arguments

  • listener - a bound TCP socket
  • timeout - timeout duration of incoming requests, any connection that does not send requests within this time period will be closed. In the future it should be possible to create long-lived queries, but these should be from trusted sources only, this would require some type of whitelisting.

pub async fn block_until_done(self) -> Result<(), ProtoError>[src]

This will run until all background tasks of the trust_dns_server end.

Auto Trait Implementations

impl<T> !RefUnwindSafe for ServerFuture<T>

impl<T> Send for ServerFuture<T>

impl<T> Sync for ServerFuture<T>

impl<T> Unpin for ServerFuture<T>

impl<T> !UnwindSafe for ServerFuture<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,