pub struct Message {
pub header: Header,
pub questions: Vec<Question>,
pub answers: Vec<ResourceRecord>,
pub authority: Vec<ResourceRecord>,
pub additional: Vec<ResourceRecord>,
}
Expand description
Basic DNS message format, used for both queries and responses.
+---------------------+
| Header |
+---------------------+
| Question | the question for the name server
+---------------------+
| Answer | RRs answering the question
+---------------------+
| Authority | RRs pointing toward an authority
+---------------------+
| Additional | RRs holding additional information
+---------------------+
See section 4.1 of RFC 1035.
Fields§
§header: Header
§questions: Vec<Question>
§answers: Vec<ResourceRecord>
§additional: Vec<ResourceRecord>
Implementations§
Source§impl Message
impl Message
Sourcepub fn from_octets(octets: &[u8]) -> Result<Self, Error>
pub fn from_octets(octets: &[u8]) -> Result<Self, Error>
§Errors
If the message cannot be parsed.
Sourcefn deserialise(buffer: &mut ConsumableBuffer<'_>) -> Result<Self, Error>
fn deserialise(buffer: &mut ConsumableBuffer<'_>) -> Result<Self, Error>
§Errors
If the message cannot be parsed.
Source§impl Message
impl Message
Source§impl Message
impl Message
pub fn make_response(&self) -> Self
pub fn make_format_error_response(id: u16) -> Self
pub fn from_question(id: u16, question: Question) -> Self
Trait Implementations§
Source§impl Ord for Message
impl Ord for Message
Source§impl PartialOrd for Message
impl PartialOrd for Message
impl Eq for Message
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more