Skip to main content

Shape

Enum Shape 

Source
pub enum Shape {
    Base {
        name: String,
        encoding: Encoding,
        size: u64,
    },
    Pointer {
        to: Option<usize>,
        size: u64,
    },
    Array {
        of: usize,
        count: Option<u64>,
    },
    Record {
        union: bool,
        name: Option<String>,
        size: Option<u64>,
        members: Option<Vec<Member>>,
    },
    Enumeration {
        name: Option<String>,
        of: usize,
        size: u64,
        values: Vec<Constant>,
    },
    Alias {
        name: String,
        of: Option<usize>,
    },
    Qualified {
        which: Qualifier,
        of: Option<usize>,
    },
    Subroutine(Sig),
}
Expand description

One type, in the terms DWARF describes one.

Variants§

§

Base

A type whose bytes are read directly, which is every arithmetic type C has.

Fields

§name: String

What it is called, which is the spelling the program would have written.

§encoding: Encoding

How its bits are read.

§size: u64

How many bytes it is.

§

Pointer

A pointer, whose target is None for void *.

Fields

§to: Option<usize>

Which of the unit’s types it points at.

§size: u64

How many bytes the pointer itself is.

§

Array

An array, whose length is None when it has none a number can say.

That covers three C spellings at once: the flexible array member, the array of unknown length, and the array whose length is an expression. DWARF can describe the last of those with an expression of its own, which is worth doing and is not done here, and leaving the bound out is the answer a debugger already has to handle for the other two.

Fields

§of: usize

Which of the unit’s types the elements are.

§count: Option<u64>

How many of them there are.

§

Record

A struct or a union, whose members are None when it is incomplete.

Fields

§union: bool

Whether it is a union rather than a struct.

§name: Option<String>

Its tag, absent for one the program left anonymous.

§size: Option<u64>

How many bytes it is, and nothing for an incomplete one.

§members: Option<Vec<Member>>

The members in the order they were written, and None for an incomplete record, which is a different thing from a complete record with no members.

§

Enumeration

An enum.

Fields

§name: Option<String>

Its tag, absent for one the program left anonymous.

§of: usize

Which of the unit’s types the enumerators are held in.

§size: u64

How many bytes it is.

§values: Vec<Constant>

The enumerators in the order the program wrote them.

Empty for an enumeration that has not been completed, which is a thing a C program can mention but cannot have an object of.

§

Alias

A typedef name for another type.

Fields

§name: String

The name.

§of: Option<usize>

Which of the unit’s types it stands for, and None for a name for void.

§

Qualified

A qualified version of another type.

Fields

§which: Qualifier

Which qualifier.

§of: Option<usize>

Which of the unit’s types it qualifies, and None for qualified void.

§

Subroutine(Sig)

A function type, which is what a pointer to a function points at.

Trait Implementations§

Source§

impl Clone for Shape

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Shape

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Shape

Source§

impl PartialEq for Shape

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Shape

Auto Trait Implementations§

§

impl Freeze for Shape

§

impl RefUnwindSafe for Shape

§

impl Send for Shape

§

impl Sync for Shape

§

impl Unpin for Shape

§

impl UnsafeUnpin for Shape

§

impl UnwindSafe for Shape

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.