fn try_generating_error(
    received: &Reader,
    question: Option<&Question>,
    rcode: Rcode,
    response_buf: &mut [u8],
) -> writer::Result<usize> {
    let mut response = Writer::try_from(response_buf)?;
    set_up_response_header(received, &mut response);
    response.set_rcode(rcode);
    if let Some(question) = question {
        response.add_question(question)?;
    }
    Ok(response.finish())
}
/// Attempts to write an error response with the given RCODE and
/// (optionally) question into the provided buffer.
Attempts to write an error response with the given RCODE and
(optionally) question into the provided buffer.
Attempts to write an error response with the given RCODE and ( optionally ) question into the provided buffer .
fn try_generating_error(
    received: &Reader,
    question: Option<&Question>,
    rcode: Rcode,
    response_buf: &mut [u8],
) -> writer::Result<usize> {
    let mut response = Writer::try_from(response_buf)?;
    set_up_response_header(received, &mut response);
    response.set_rcode(rcode);
    if let Some(question) = question {
        response.add_question(question)?;
    }
    Ok(response.finish())
}
fn try_generating_error ( received : & Reader , question : Option < & Question > , rcode : Rcode , response_buf : & mut [ u8 ] , ) -> writer :: Result < usize > { let mut response = Writer :: try_from ( response_buf ) ? ; set_up_response_header ( received , & mut response ) ; response . set_rcode ( rcode ) ; if let Some ( question ) = question { response . add_question ( question ) ? ; } Ok ( response . finish ( ) ) }
Attempts to write an error response with the given RCODE and
(optionally) question into the provided buffer.
Attempts to write an error response with the given RCODE and ( optionally ) question into the provided buffer .
received
&Reader
question
Option<&Question>
rcode
Rcode
response_buf
&mut [u8]
received
&Reader
question
Option<&Question>
rcode
Rcode
response_buf
&mut [u8]