Trait ParseAll

Source
pub trait ParseAll: Sized {
    type Err: From<ShortBuf> + Fail;

    // Required method
    fn parse_all(parser: &mut Parser, len: usize) -> Result<Self, Self::Err>;
}
Expand description

A type that can extract a value from a given part of a parser.

This trait is used when the length of a value is known before and the value is expected to stretch over this entire length. There are types that can implement ParseAll but not Parse because they simply take all remaining bytes.

Required Associated Types§

Source

type Err: From<ShortBuf> + Fail

The type returned when parsing fails.

Required Methods§

Source

fn parse_all(parser: &mut Parser, len: usize) -> Result<Self, Self::Err>

Parses a value len bytes long from the beginning of the parser.

An implementation must read exactly len bytes from the parser or fail. If it fails, the position of the parser is considered undefined.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ParseAll for u8

Source§

type Err = ParseAllError

Source§

fn parse_all(parser: &mut Parser, len: usize) -> Result<Self, Self::Err>

Source§

impl ParseAll for u16

Source§

type Err = ParseAllError

Source§

fn parse_all(parser: &mut Parser, len: usize) -> Result<Self, Self::Err>

Source§

impl ParseAll for u32

Source§

type Err = ParseAllError

Source§

fn parse_all(parser: &mut Parser, len: usize) -> Result<Self, Self::Err>

Source§

impl ParseAll for Ipv4Addr

Source§

type Err = ParseAllError

Source§

fn parse_all(parser: &mut Parser, len: usize) -> Result<Self, Self::Err>

Source§

impl ParseAll for Ipv6Addr

Source§

type Err = ParseAllError

Source§

fn parse_all(parser: &mut Parser, len: usize) -> Result<Self, Self::Err>

Source§

impl ParseAll for Bytes

Source§

type Err = ShortBuf

Source§

fn parse_all(parser: &mut Parser, len: usize) -> Result<Self, Self::Err>

Implementors§

Source§

impl ParseAll for A

Source§

impl ParseAll for Cname<ParsedDname>

Source§

impl ParseAll for Hinfo

Source§

impl ParseAll for Mb<ParsedDname>

Source§

impl ParseAll for Md<ParsedDname>

Source§

impl ParseAll for Mf<ParsedDname>

Source§

impl ParseAll for Mg<ParsedDname>

Source§

impl ParseAll for Mr<ParsedDname>

Source§

impl ParseAll for Ns<ParsedDname>

Source§

impl ParseAll for Null

Source§

impl ParseAll for Ptr<ParsedDname>

Source§

impl ParseAll for Txt

Source§

impl ParseAll for Wks

Source§

impl ParseAll for Aaaa

Source§

impl ParseAll for Dnskey

Source§

impl ParseAll for Ds

Source§

impl ParseAll for Nsec

Source§

impl ParseAll for Rrsig

Source§

impl ParseAll for RtypeBitmap

Source§

impl ParseAll for Nsec3

Source§

impl ParseAll for Nsec3param

Source§

impl ParseAll for CharStr

Source§

impl ParseAll for Dname

Source§

impl ParseAll for ParsedDname

Source§

impl ParseAll for Nsid

Source§

impl ParseAll for Dau

Source§

impl ParseAll for Dhu

Source§

impl ParseAll for N3u

Source§

impl ParseAll for Expire

Source§

impl ParseAll for TcpKeepalive

Source§

impl ParseAll for Padding

Source§

impl ParseAll for ClientSubnet

Source§

impl ParseAll for Chain

Source§

impl ParseAll for KeyTag

Source§

impl ParseAll for Opt

Source§

impl ParseAll for Serial

Source§

impl<N: Parse + ParseAll> ParseAll for Minfo<N>
where <N as ParseAll>::Err: From<<N as Parse>::Err> + From<ShortBuf>,

Source§

type Err = <N as ParseAll>::Err

Source§

impl<N: ParseAll + Parse> ParseAll for Soa<N>
where <N as ParseAll>::Err: From<<N as Parse>::Err> + From<ParseAllError>, <N as Parse>::Err: From<ShortBuf>,

Source§

type Err = <N as ParseAll>::Err

Source§

impl<N: ParseAll> ParseAll for Mx<N>

Source§

type Err = <N as ParseAll>::Err

Source§

impl<N: ParseAll> ParseAll for Srv<N>
where N::Err: From<ParseOpenError>,

Source§

type Err = <N as ParseAll>::Err