pub struct DnsSocket { /* private fields */ }Expand description
DNS UDP socket
Implementations§
Source§impl DnsSocket
impl DnsSocket
Sourcepub async fn new(
listening: SocketAddr,
icann_fallback: SocketAddr,
handler: HandlerHolder,
) -> Result<Self>
pub async fn new( listening: SocketAddr, icann_fallback: SocketAddr, handler: HandlerHolder, ) -> Result<Self>
Creates a new DNS socket
Sourcepub async fn send_to(&self, buffer: &[u8], target: &SocketAddr) -> Result<usize>
pub async fn send_to(&self, buffer: &[u8], target: &SocketAddr) -> Result<usize>
Send message to address
Sourcepub async fn receive_loop(&mut self)
pub async fn receive_loop(&mut self)
Run receive loop
Sourcepub async fn query(&mut self, query: &Vec<u8>) -> Result<Vec<u8>, RequestError>
pub async fn query(&mut self, query: &Vec<u8>) -> Result<Vec<u8>, RequestError>
Query this dns for data
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DnsSocket
impl !RefUnwindSafe for DnsSocket
impl Send for DnsSocket
impl Sync for DnsSocket
impl Unpin for DnsSocket
impl !UnwindSafe for DnsSocket
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