pub struct Parser<'a> {
    pub msg: &'a [u8],
    pub header: HeaderInternal,
    pub section: Section,
    pub off: usize,
    pub index: usize,
    pub res_header_valid: bool,
    pub res_header: ResourceHeader,
}

Fields§

§msg: &'a [u8]§header: HeaderInternal§section: Section§off: usize§index: usize§res_header_valid: bool§res_header: ResourceHeader

Implementations§

source§

impl<'a> Parser<'a>

source

pub fn start(&mut self, msg: &'a [u8]) -> Result<Header, Error>

source

pub fn question(&mut self) -> Result<Question, Error>

source

pub fn all_questions(&mut self) -> Result<Vec<Question>, Error>

source

pub fn skip_question(&mut self) -> Result<(), Error>

source

pub fn skip_all_questions(&mut self) -> Result<(), Error>

source

pub fn answer_header(&mut self) -> Result<ResourceHeader, Error>

source

pub fn answer(&mut self) -> Result<Resource, Error>

source

pub fn all_answers(&mut self) -> Result<Vec<Resource>, Error>

source

pub fn skip_answer(&mut self) -> Result<(), Error>

source

pub fn skip_all_answers(&mut self) -> Result<(), Error>

source

pub fn authority_header(&mut self) -> Result<ResourceHeader, Error>

source

pub fn authority(&mut self) -> Result<Resource, Error>

source

pub fn all_authorities(&mut self) -> Result<Vec<Resource>, Error>

source

pub fn skip_authority(&mut self) -> Result<(), Error>

source

pub fn skip_all_authorities(&mut self) -> Result<(), Error>

source

pub fn additional_header(&mut self) -> Result<ResourceHeader, Error>

source

pub fn additional(&mut self) -> Result<Resource, Error>

source

pub fn all_additionals(&mut self) -> Result<Vec<Resource>, Error>

source

pub fn skip_additional(&mut self) -> Result<(), Error>

source

pub fn skip_all_additionals(&mut self) -> Result<(), Error>

source

pub fn resource_body(&mut self) -> Result<Box<dyn ResourceBody>, Error>

Trait Implementations§

source§

impl<'a> Default for Parser<'a>

source§

fn default() -> Parser<'a>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for Parser<'a>

§

impl<'a> Send for Parser<'a>

§

impl<'a> Sync for Parser<'a>

§

impl<'a> Unpin for Parser<'a>

§

impl<'a> UnwindSafe for Parser<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.