Skip to main content

TypeWalkSink

Trait TypeWalkSink 

Source
pub trait TypeWalkSink {
    // Required methods
    fn scalar(
        &mut self,
        kind: u32,
        bytes: u32,
        is_signed: u32,
        size: u64,
        has_size: u32,
    ) -> u32;
    fn ptr(&mut self, target: u32, size: u64, has_size: u32) -> u32;
    fn array(&mut self, elem: u32, nelems: u64, size: u64, has_size: u32) -> u32;
    fn func(&mut self, ret: u32, params: &[u32], vararg: u32) -> u32;
    fn opaque(&mut self, name: String) -> u32;
    fn named_ref(&mut self, name: String) -> u32;
    fn anon(&mut self) -> u32;
    fn fill_struct(
        &mut self,
        id: u32,
        is_union: bool,
        members: &[MemberInfo],
        size: u64,
        has_size: u32,
    );
    fn fill_enum(
        &mut self,
        id: u32,
        underlying: u32,
        consts: &[EnumConstInfo],
        size: u64,
        has_size: u32,
        is_bitmask: bool,
        repr_vtype: u32,
        repr_signed: bool,
        repr_leading_zeros: bool,
    );
    fn fill_typedef(&mut self, id: u32, underlying: u32);
}
Expand description

A walk target the type visitor drives inline, one method per tinfo node kind.

The consumer (idakit) implements it over its own interned type table, and TypeWalkVisitor forwards every C++ call straight into it. Handle-returning methods mint and return the walk-local id the parent will reference (children are visited before parents); the fill_* methods complete a placeholder minted earlier by named_ref/anon. A type name crosses as an owned String, decoded leniently facade-side; slices are borrowed for the one call only.

Required Methods§

Source

fn scalar( &mut self, kind: u32, bytes: u32, is_signed: u32, size: u64, has_size: u32, ) -> u32

A scalar leaf (kind: 0 unknown, 1 void, 2 bool, 3 integral, 4 float); returns its handle.

Source

fn ptr(&mut self, target: u32, size: u64, has_size: u32) -> u32

A pointer to the already-visited target; returns its handle.

Source

fn array(&mut self, elem: u32, nelems: u64, size: u64, has_size: u32) -> u32

An array of nelems of the already-visited elem; returns its handle.

Source

fn func(&mut self, ret: u32, params: &[u32], vararg: u32) -> u32

A function of the already-visited ret and params; returns its handle.

Source

fn opaque(&mut self, name: String) -> u32

A named-but-bodyless / unresolved leaf carrying its resolved name; returns its handle.

Source

fn named_ref(&mut self, name: String) -> u32

A by-name placeholder for a named aggregate/typedef; returns its handle.

Source

fn anon(&mut self) -> u32

An anonymous-aggregate placeholder; returns its handle.

Source

fn fill_struct( &mut self, id: u32, is_union: bool, members: &[MemberInfo], size: u64, has_size: u32, )

Fills the struct/union placeholder id with its members.

Source

fn fill_enum( &mut self, id: u32, underlying: u32, consts: &[EnumConstInfo], size: u64, has_size: u32, is_bitmask: bool, repr_vtype: u32, repr_signed: bool, repr_leading_zeros: bool, )

Fills the enum placeholder id with its consts over the already-visited underlying. repr_vtype/repr_signed/repr_leading_zeros are the enum’s own value_repr_t, the same shape MemberInfo carries per-member (0 = FRB_UNK/unmodeled).

Source

fn fill_typedef(&mut self, id: u32, underlying: u32)

Fills the typedef placeholder id with its already-visited underlying.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§