Struct trust_dns_server::ServerFuture [−][src]
pub struct ServerFuture<T: RequestHandler> { /* fields omitted */ }
A Futures based implementation of a DNS server
Implementations
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)
[src]
Register a UDP socket. Should be bound before calling this function.
pub fn register_socket_std(&mut self, socket: UdpSocket) -> Result<()>
[src]
Register a UDP socket. Should be bound before calling this function.
pub fn register_listener(&mut self, listener: TcpListener, timeout: Duration)
[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 sockettimeout
- 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
) -> Result<()>
[src]
&mut self,
listener: TcpListener,
timeout: Duration
) -> Result<()>
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 sockettimeout
- 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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,