pub trait CanParse<'data>: Sized + Deref<Target = RawParser<'data>> + DerefMut {
    type Endian;

Show 18 methods fn is_big_endian(&self) -> bool; fn u8(&mut self) -> Res<u8>; fn u16(&mut self) -> Res<u16>; fn u32(&mut self) -> Res<u32>; fn u64(&mut self) -> Res<u64>; fn f64(&mut self) -> Res<f64>; fn clock(&mut self) -> Res<u64> { ... } fn v_usize(&mut self) -> Res<usize> { ... } fn alloc(
        &mut self,
        timestamp: u64,
        cxt: &mut Cxt<'data>,
        short: Option<usize>
    ) -> Res<Alloc> { ... } fn alloc_uid_from_delta(&mut self, cxt: &Cxt<'data>) -> Res<u64> { ... } fn locs(&mut self, cxt: &mut Cxt<'data>) -> Res<Locs<'data>> { ... } fn cache_check(&mut self) -> Res<CacheCheck> { ... } fn event_kind(&mut self, header: &Header) -> Res<(Kind, DeltaClock)> { ... } fn packet_header(&mut self, id: usize) -> Res<Packet> { ... } fn ctf_header(&mut self) -> Res<Ctf> { ... } fn raw_package_header(
        &mut self,
        parse_magic: bool
    ) -> Res<(Header, CacheCheck)> { ... } fn trace_info(&mut self, header: &Ctf) -> Res<Info<'data>> { ... } fn magic(&mut self) -> Res<()> { ... }
}
Expand description

Trait implemented by the big-endian parser and the low-endian parser.

Required Associated Types

Type describing the endian convention: big or low.

Required Methods

True if the parser is big-endian.

Parses a u8.

Parses a u16.

Parses a u32.

Parses a u64.

Parses an f64.

Provided Methods

Parses a clock value.

Parses a usize in memtrace’s variable-length format.

Parses an allocation.

Context-sensitive.

Parses an allocation UID from a delta w.r.t. the most recent UID generated.

Context-sensitive.

Used when retrieving the UID of a promotion/collection.

Panics

Calling this function before any allocation UID is generated is a logical error. As long as this function is used only for promotion/collection, it will not panic on coherent CTF files. This is because promoting/collecting necessarily talks about an allocation that was created previously, meaning at least one allocation UID was generated.

In debug, the code actually debug_asserts this. In release, the panic will be an arithmetic underflow.

Parses some new locations.

Context-sensitive.

Parses cache-checking information.

Parses an event header.

Parses a packet header.

A packet is a sequence of events.

Parses the top-level CTF header.

The CTF header is the first element of a CTF file, followed by the trace info, and then the sequence of packets.

Raw package header parser.

Returns internal errors as they are, should only be called by ctf_header and packet_header which enrich these errors.

Parses a trace info.

Technically, a trace info is a normal event, meaning it could appear in a normal packet. However, currently the trace info needs to be unique and appear between the CTF (top-level) header and the first package of the trace.

Parses the memtrace CTF magic number.

Implementors