pub struct DnsQuestion<'a> {
pub name: &'a [u8],
pub type_: Type,
}Expand description
A question in a DNS packet.
Fields§
§name: &'a [u8]The name, in wire format. May contain compression pointers.
type_: TypeThe record type asked for.
Implementations§
Source§impl<'a> Question<'a>
impl<'a> Question<'a>
Sourcepub fn parse(buffer: &'a [u8]) -> Result<(&'a [u8], Question<'a>)>
pub fn parse(buffer: &'a [u8]) -> Result<(&'a [u8], Question<'a>)>
Parse a question from the start of buffer.
Returns the rest of the buffer and the question. Fails if the class is not IN.
Sourcepub const fn buffer_len(&self) -> usize
pub const fn buffer_len(&self) -> usize
Length of this question on the wire.
Sourcepub fn emit(&self, packet: &mut [u8])
pub fn emit(&self, packet: &mut [u8])
Write this question at the start of packet.
Panics if packet is shorter than buffer_len.
Trait Implementations§
impl<'a> Eq for Question<'a>
impl<'a> StructuralPartialEq for Question<'a>
Auto Trait Implementations§
impl<'a> Freeze for Question<'a>
impl<'a> RefUnwindSafe for Question<'a>
impl<'a> Send for Question<'a>
impl<'a> Sync for Question<'a>
impl<'a> Unpin for Question<'a>
impl<'a> UnsafeUnpin for Question<'a>
impl<'a> UnwindSafe for Question<'a>
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