fn generate_error(
    received: &Reader,
    question: Option<&Question>,
    rcode: Rcode,
    response_buf: &mut [u8],
) -> Response {
    if let Ok(response_len) = try_generating_error(received, question, rcode, response_buf) {
        Response::Single(response_len)
    } else {
        error!("try_generating_error failed. This is a bug.");
        Response::None
    }
}
/// Writes an error response with the given RCODE and (optionally)
/// question into the provided buffer, producing a [`Response`].
///
/// This is intended for use early on in processing, when a response
/// [`Writer`] has not yet been set up.
Writes an error response with the given RCODE and (optionally)
question into the provided buffer, producing a [`Response`].

This is intended for use early on in processing, when a response
[`Writer`] has not yet been set up.
Writes an error response with the given RCODE and ( optionally ) question into the provided buffer producing a [ ` Response ` ] . This is intended for use early on in processing when a response [ ` Writer ` ] has not yet been set up .
fn generate_error(
    received: &Reader,
    question: Option<&Question>,
    rcode: Rcode,
    response_buf: &mut [u8],
) -> Response {
    if let Ok(response_len) = try_generating_error(received, question, rcode, response_buf) {
        Response::Single(response_len)
    } else {
        error!("try_generating_error failed. This is a bug.");
        Response::None
    }
}
fn generate_error ( received : & Reader , question : Option < & Question > , rcode : Rcode , response_buf : & mut [ u8 ] , ) -> Response { if let Ok ( response_len ) = try_generating_error ( received , question , rcode , response_buf ) { Response :: Single ( response_len ) } else { error ! ( " " ) ; Response :: None } }
Writes an error response with the given RCODE and (optionally)
question into the provided buffer, producing a [`Response`].
Writes an error response with the given RCODE and ( optionally ) question into the provided buffer producing a [ ` Response ` ] .
received
&Reader
question
Option<&Question>
rcode
Rcode
response_buf
&mut [u8]
received
&Reader
question
Option<&Question>
rcode
Rcode
response_buf
&mut [u8]