pub struct QuestionRef<'a> { /* private fields */ }Expand description
A parsed DNS question (zero-copy reference into a message buffer).
Implementations§
Source§impl<'a> QuestionRef<'a>
impl<'a> QuestionRef<'a>
Sourcepub fn try_parse(
message: &'a [u8],
offset: usize,
) -> Result<(Self, usize), ParseError>
pub fn try_parse( message: &'a [u8], offset: usize, ) -> Result<(Self, usize), ParseError>
Parse a question starting at offset in message.
Returns the question and the next offset to continue parsing from.
Sourcepub const fn qtype(&self) -> ResourceType
pub const fn qtype(&self) -> ResourceType
Returns the question type.
Sourcepub const fn qclass(&self) -> ResourceClass
pub const fn qclass(&self) -> ResourceClass
Returns the question class (with unicast-response bit stripped).
Sourcepub const fn unicast_response_requested(&self) -> bool
pub const fn unicast_response_requested(&self) -> bool
true if the unicast-response bit (RFC 6762 §5.4) was set on this
question’s class field.
Trait Implementations§
Source§impl<'a> Clone for QuestionRef<'a>
impl<'a> Clone for QuestionRef<'a>
Source§fn clone(&self) -> QuestionRef<'a>
fn clone(&self) -> QuestionRef<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for QuestionRef<'a>
Source§impl<'a> Debug for QuestionRef<'a>
impl<'a> Debug for QuestionRef<'a>
impl<'a> Eq for QuestionRef<'a>
Source§impl<'a> Hash for QuestionRef<'a>
impl<'a> Hash for QuestionRef<'a>
Source§impl<'a> PartialEq for QuestionRef<'a>
impl<'a> PartialEq for QuestionRef<'a>
Source§fn eq(&self, other: &QuestionRef<'a>) -> bool
fn eq(&self, other: &QuestionRef<'a>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'a> StructuralPartialEq for QuestionRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for QuestionRef<'a>
impl<'a> RefUnwindSafe for QuestionRef<'a>
impl<'a> Send for QuestionRef<'a>
impl<'a> Sync for QuestionRef<'a>
impl<'a> Unpin for QuestionRef<'a>
impl<'a> UnsafeUnpin for QuestionRef<'a>
impl<'a> UnwindSafe for QuestionRef<'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