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
FunctionImport
An import of a function/routine defined in a shared library
DataImport
A GOT-based import of data defined in a shared library
Function
A function defined in this artifact
Fields of Function
global: bool |
Data
A data object defined in this artifact
Fields of Data
global: bool | |
writeable: bool |
CString
A null-terminated string object defined in this artifact
Fields of CString
global: bool |
Methods
impl Decl
[src]
pub fn absorb(&mut self, other: Self) -> Result<(), Error>
[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:
- Duplicate declarations are no-ops / ignored.
- 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.
- If the previous declaration was a
Function
orData
declaration, then a subsequent correspondingFunctionImport
orDataImport
is a no-op. - Anything else is a IncompatibleDeclaration error!
pub fn is_import(&self) -> bool
[src]
Is this an import (function or data) from a shared library?
Trait Implementations
impl Debug for Decl
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Copy for Decl
[src]
impl Clone for Decl
[src]
fn clone(&self) -> Decl
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for Decl
[src]
fn eq(&self, __arg_0: &Decl) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Decl) -> bool
[src]
This method tests for !=
.