pub struct LibManifest {
pub id: Symbol,
pub version: Version,
pub abi: AbiVersion,
pub target: LibTarget,
pub requires: Vec<Dependency>,
pub capabilities: Vec<CapabilityName>,
pub exports: Vec<Export>,
}Expand description
The self-description a library presents at load time.
The manifest names the library, its version and ABI, how it is loaded, what it requires, what capabilities it requests, and what it exports. The kernel validates and registers against this; the library supplies it.
Fields§
§id: SymbolSymbol identifying the library.
version: VersionThe library’s version.
abi: AbiVersionThe ABI version the library targets.
target: LibTargetHow the library is loaded.
requires: Vec<Dependency>Other libraries this one depends on.
capabilities: Vec<CapabilityName>Capabilities the library requests at load time.
exports: Vec<Export>The exports the library declares.
Implementations§
Source§impl LibManifest
impl LibManifest
Sourcepub fn declared_export_records(&self) -> Vec<ExportRecord>
pub fn declared_export_records(&self) -> Vec<ExportRecord>
Returns a Declared ExportRecord for each
declared export.
§Examples
use sim_kernel::library::{
AbiVersion, Export, ExportKind, LibManifest, LibTarget, Version,
};
use sim_kernel::Symbol;
let manifest = LibManifest {
id: Symbol::new("demo"),
version: Version("0.1.0".to_owned()),
abi: AbiVersion { major: 0, minor: 1 },
target: LibTarget::HostRegistered,
requires: Vec::new(),
capabilities: Vec::new(),
exports: vec![Export::Value { symbol: Symbol::new("answer") }],
};
let records = manifest.declared_export_records();
assert_eq!(records.len(), 1);
assert_eq!(records[0].kind, ExportKind::named(ExportKind::VALUE));Trait Implementations§
Source§impl Clone for LibManifest
impl Clone for LibManifest
Source§fn clone(&self) -> LibManifest
fn clone(&self) -> LibManifest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LibManifest
impl Debug for LibManifest
impl Eq for LibManifest
Source§impl PartialEq for LibManifest
impl PartialEq for LibManifest
Source§fn eq(&self, other: &LibManifest) -> bool
fn eq(&self, other: &LibManifest) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for LibManifest
Auto Trait Implementations§
impl Freeze for LibManifest
impl RefUnwindSafe for LibManifest
impl Send for LibManifest
impl Sync for LibManifest
impl Unpin for LibManifest
impl UnsafeUnpin for LibManifest
impl UnwindSafe for LibManifest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more