pub enum Decl {
FunctionImport,
DataImport,
Function {
global: bool,
},
Data {
global: bool,
writable: bool,
},
CString {
global: bool,
},
}
The kind of declaration this is
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
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
or Data
declaration,
then a subsequent corresponding FunctionImport
or DataImport
is a no-op.
- Anything else is a IncompatibleDeclaration error!
Is this an import (function or data) from a shared library?
Formats the value using the given formatter. Read more
Performs copy-assignment from source
. Read more
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.