[][src]Enum faerie::Decl

pub enum Decl {
    Import(ImportKind),
    Defined(DefinedDecl),
}

The kind of declaration this is

Variants

Import(ImportKind)

Declaration of an import

Defined(DefinedDecl)

Declaration of an item to be defined in this artifact

Methods

impl Decl[src]

pub fn function_import() -> FunctionImportDecl[src]

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

pub fn data_import() -> DataImportDecl[src]

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

pub fn function() -> FunctionDecl[src]

A function defined in this artifact

pub fn data() -> DataDecl[src]

A data object defined in this artifact

pub fn cstring() -> DataDecl[src]

A null-terminated string object defined in this artifact

pub fn debug_section() -> DebugSectionDecl[src]

A DWARF debug section defined in this artifact

pub fn absorb(&mut self, other: Self) -> Result<(), ArtifactError>[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!

pub fn is_import(&self) -> bool[src]

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

pub fn is_section(&self) -> bool[src]

Is this a section?

Trait Implementations

impl Clone for Decl[src]

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Ord for Decl[src]

default fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

default fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

default fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl Eq for Decl[src]

impl Into<Decl> for FunctionImportDecl[src]

impl Into<Decl> for DataImportDecl[src]

impl Into<Decl> for FunctionDecl[src]

impl Into<Decl> for DataDecl[src]

impl Into<Decl> for DebugSectionDecl[src]

impl PartialOrd<Decl> for Decl[src]

impl Copy for Decl[src]

impl PartialEq<Decl> for Decl[src]

impl Debug for Decl[src]

Auto Trait Implementations

impl Send for Decl

impl Sync for Decl

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

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