OMDomainResolver

Struct OMDomainResolver 

Source
pub struct OMDomainResolver<PH: Deref>{ /* private fields */ }
Expand description

A resolver which implements DNSResolverMessageHandler and replies to DNSSECQuery messages with with DNSSECProofs.

Implementations§

Source§

impl OMDomainResolver<IgnoringMessageHandler>

Source

pub fn ignoring_incoming_proofs(resolver: SocketAddr) -> Self

Creates a new OMDomainResolver given the SocketAddr of a DNS resolver listening on TCP (e.g. 8.8.8.8:53, 1.1.1.1:53 or your local DNS resolver).

Ignores any incoming DNSSECProof messages.

Source§

impl<PH: Deref> OMDomainResolver<PH>

Source

pub fn new(resolver: SocketAddr, proof_handler: Option<PH>) -> Self

Creates a new OMDomainResolver given the SocketAddr of a DNS resolver listening on TCP (e.g. 8.8.8.8:53, 1.1.1.1:53 or your local DNS resolver).

Uses tokio’s Handle::current to fetch the async runtime on which futures will be spawned.

The optional proof_handler can be provided to pass proofs coming back to us to the underlying handler. This is useful when this resolver is handling incoming resolution requests but some other handler is making proof requests of remote nodes and wants to get results.

Source

pub fn with_runtime( resolver: SocketAddr, proof_handler: Option<PH>, runtime_handle: Option<Handle>, ) -> Self

Creates a new OMDomainResolver given the SocketAddr of a DNS resolver listening on TCP (e.g. 8.8.8.8:53, 1.1.1.1:53 or your local DNS resolver) and a tokio runtime Handle on which futures will be spawned. If no runtime is provided, set_runtime must be called before any queries will be handled.

The optional proof_handler can be provided to pass proofs coming back to us to the underlying handler. This is useful when this resolver is handling incoming resolution requests but some other handler is making proof requests of remote nodes and wants to get results.

Source

pub fn set_runtime(&self, runtime_handle: Handle)

Sets the runtime on which futures will be spawned.

Trait Implementations§

Source§

impl<PH: Deref> DNSResolverMessageHandler for OMDomainResolver<PH>

Source§

fn handle_dnssec_proof(&self, proof: DNSSECProof, context: DNSResolverContext)

Handle a DNSSECProof message (in response to a DNSSECQuery we presumably sent). Read more
Source§

fn handle_dnssec_query( &self, q: DNSSECQuery, responder_opt: Option<Responder>, ) -> Option<(DNSResolverMessage, ResponseInstruction)>

Handle a DNSSECQuery message. Read more
Source§

fn provided_node_features(&self) -> NodeFeatures

Gets the node feature flags which this handler itself supports. Useful for setting the dns_resolver flag if this handler supports returning DNSSECProof messages in response to DNSSECQuery messages.
Source§

fn release_pending_messages( &self, ) -> Vec<(DNSResolverMessage, MessageSendInstructions)>

Release any DNSResolverMessages that need to be sent.

Auto Trait Implementations§

§

impl<PH> !Freeze for OMDomainResolver<PH>

§

impl<PH> RefUnwindSafe for OMDomainResolver<PH>
where PH: RefUnwindSafe,

§

impl<PH> Send for OMDomainResolver<PH>
where PH: Send,

§

impl<PH> Sync for OMDomainResolver<PH>
where PH: Sync,

§

impl<PH> Unpin for OMDomainResolver<PH>
where PH: Unpin,

§

impl<PH> UnwindSafe for OMDomainResolver<PH>
where PH: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.