fn answer_any(zone: &Zone, qname: &Name, response: &mut Writer) -> ProcessingResult<()> {
    match zone.lookup_all(qname) {
        LookupAllResult::Found(rrsets) => {
            response.set_aa(true);
            let mut n_added = 0;
            for rrset in rrsets.iter() {
                response.add_answer_rrset(qname, rrset)?;
                n_added += 1;
            }
            if n_added == 0 {
                add_negative_caching_soa(zone, response)?;
            }
            Ok(())
        }
        LookupAllResult::Referral(child_zone, ns_rrset) => {
            do_referral(zone, child_zone, ns_rrset, response)
        }
        LookupAllResult::NxDomain => {
            response.set_rcode(Rcode::NxDomain);
            response.set_aa(true);
            add_negative_caching_soa(zone, response)
        }
        LookupAllResult::WrongZone => {
            response.set_rcode(Rcode::Refused);
            Ok(())
        }
    }
}
/// Answers a query with QTYPE * (ANY) once the appropriate zone to
/// search has been determined.
Answers a query with QTYPE * (ANY) once the appropriate zone to
search has been determined.
Answers a query with QTYPE * ( ANY ) once the appropriate zone to search has been determined .
fn answer_any(zone: &Zone, qname: &Name, response: &mut Writer) -> ProcessingResult<()> {
    match zone.lookup_all(qname) {
        LookupAllResult::Found(rrsets) => {
            response.set_aa(true);
            let mut n_added = 0;
            for rrset in rrsets.iter() {
                response.add_answer_rrset(qname, rrset)?;
                n_added += 1;
            }
            if n_added == 0 {
                add_negative_caching_soa(zone, response)?;
            }
            Ok(())
        }
        LookupAllResult::Referral(child_zone, ns_rrset) => {
            do_referral(zone, child_zone, ns_rrset, response)
        }
        LookupAllResult::NxDomain => {
            response.set_rcode(Rcode::NxDomain);
            response.set_aa(true);
            add_negative_caching_soa(zone, response)
        }
        LookupAllResult::WrongZone => {
            response.set_rcode(Rcode::Refused);
            Ok(())
        }
    }
}
fn answer_any ( zone : & Zone , qname : & Name , response : & mut Writer ) -> ProcessingResult < ( ) > { match zone . lookup_all ( qname ) { LookupAllResult :: Found ( rrsets ) => { response . set_aa ( true ) ; let mut n_added = 0 ; for rrset in rrsets . iter ( ) { response . add_answer_rrset ( qname , rrset ) ? ; n_added += 1 ; } if n_added == 0 { add_negative_caching_soa ( zone , response ) ? ; } Ok ( ( ) ) } LookupAllResult :: Referral ( child_zone , ns_rrset ) => { do_referral ( zone , child_zone , ns_rrset , response ) } LookupAllResult :: NxDomain => { response . set_rcode ( Rcode :: NxDomain ) ; response . set_aa ( true ) ; add_negative_caching_soa ( zone , response ) } LookupAllResult :: WrongZone => { response . set_rcode ( Rcode :: Refused ) ; Ok ( ( ) ) } } }
Answers a query with QTYPE * (ANY) once the appropriate zone to
search has been determined.
Answers a query with QTYPE * ( ANY ) once the appropriate zone to search has been determined .
zone
&Zone
qname
&Name
response
&mut Writer
zone
&Zone
qname
&Name
response
&mut Writer