Struct sparkle::WireEncoder [] [src]

pub struct WireEncoder<'a, Q: QueryOrResponse, S: EncoderState> { /* fields omitted */ }

Writes a DNS message to an external buffer.

WireEncoder guards against buffer overflow. If the external buffer is too small to contain all content, then the encoder sets the message's TC (truncation) flag and elides questions and/or resource records such that the DNS message is valid and fits within the buffer.

Methods

impl<'a, Q: QueryOrResponse> WireEncoder<'a, Q, QuestionSection>
[src]

Transitions the encoder into a state for encoding answers.

impl<'a> WireEncoder<'a, Query, QuestionSection>
[src]

impl<'a> WireEncoder<'a, Response, AnswerSection>
[src]

Constructs an encoder for encoding a response message.

The target response is initialized such that:

  • Its ID field is copied from the request.
  • Its QR bit is set.
  • Its RD bit is copied from the request.
  • Its question section is copied verbatim from the request.

If the request contains multiple questions, then the response will also contain multiple questions.

impl<'a> WireEncoder<'a, Response, AuthoritySection>
[src]

impl<'a> WireEncoder<'a, Response, AdditionalSection>
[src]

impl<'a, Q: QueryOrResponse> WireEncoder<'a, Q, Done>
[src]

Trait Implementations

impl<'a, Q: Debug + QueryOrResponse, S: Debug + EncoderState> Debug for WireEncoder<'a, Q, S>
[src]

Formats the value using the given formatter.

impl<'a, Q: Eq + QueryOrResponse, S: Eq + EncoderState> Eq for WireEncoder<'a, Q, S>
[src]

impl<'a, Q: PartialEq + QueryOrResponse, S: PartialEq + EncoderState> PartialEq for WireEncoder<'a, Q, S>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.