Enum faerie::artifact::Decl [] [src]

pub enum Decl {
    FunctionImport,
    DataImport,
    Function {
        global: bool,
    },
    Data {
        global: bool,
        writeable: bool,
    },
    CString {
        global: bool,
    },
}

The kind of declaration this is

Variants

An import of a function/routine defined in a shared library

A GOT-based import of data defined in a shared library

A function defined in this artifact

Fields of Function

A data object defined in this artifact

Fields of Data

A null-terminated string object defined in this artifact

Fields of CString

Methods

impl Decl
[src]

[src]

If it is compatible, absorb the new declaration (other) into the old (self); otherwise returns an error.

The rule here is "C-ish", but essentially:

  1. Duplicate declarations are no-ops / ignored.
  2. If the previous declaration was an FunctionImport or DataImport, then if the subsequent declaration is a corresponding matching Function or Data declaration, it is said to be "upgraded", and forever after is considered a declaration in need of a definition.
  3. If the previous declaration was a Function or Data declaration, then a subsequent corresponding FunctionImport or DataImport is a no-op.
  4. Anything else is a IncompatibleDeclaration error!

[src]

Is this an import (function or data) from a shared library?

Trait Implementations

impl Debug for Decl
[src]

[src]

Formats the value using the given formatter.

impl Copy for Decl
[src]

impl Clone for Decl
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq for Decl
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Eq for Decl
[src]