pub trait ServerService {
    fn run<'a>(
        &self,
        client: SocketAddr,
        question: &'a DnsPacket<'a>
    ) -> Option<DnsPacket<'a>>; }
Expand description

A DNS service, it recieves a DnsPacket as a question and it has to return anotherone as a response.

use dominion::{ServerService, DnsPacket};
use std::net::SocketAddr;

struct Echo;

impl ServerService for Echo {
    fn run<'a>(&self, _client: SocketAddr, question: &'a DnsPacket<'a>) -> Option<DnsPacket<'a>> { Some(question.clone()) }
}

Required Methods§

source

fn run<'a>(
    &self,
    client: SocketAddr,
    question: &'a DnsPacket<'a>
) -> Option<DnsPacket<'a>>

Take a DnsPacket as an question and return the response to be sent to the client.

Implementors§