[][src]Struct lucet_module::ModuleData

pub struct ModuleData<'a> { /* fields omitted */ }

The metadata (and some data) for a Lucet module.

The lifetime parameter exists to support zero-copy deserialization for the &str and &[u8] fields at the leaves of the structure. For a variant with owned types at the leaves, see OwnedModuleData.

The goal is for this structure to eventually include everything except the code for the guest functions themselves.

Methods

impl<'a> ModuleData<'a>[src]

pub fn new(
    linear_memory: Option<LinearMemorySpec<'a>>,
    globals_spec: Vec<GlobalSpec<'a>>,
    function_info: Vec<FunctionMetadata<'a>>,
    import_functions: Vec<ImportFunction<'a>>,
    export_functions: Vec<ExportFunction<'a>>,
    signatures: Vec<Signature>,
    features: ModuleFeatures
) -> Self
[src]

pub fn heap_spec(&self) -> Option<&HeapSpec>[src]

pub fn sparse_data(&self) -> Option<&SparseData<'a>>[src]

pub fn globals_spec(&self) -> &[GlobalSpec<'a>][src]

pub fn function_info(&self) -> &[FunctionMetadata<'a>][src]

pub fn import_functions(&self) -> &[ImportFunction][src]

pub fn export_functions(&self) -> &[ExportFunction][src]

pub fn get_signature(&self, fn_id: FunctionIndex) -> &Signature[src]

pub fn get_export_func_id(&self, name: &str) -> Option<FunctionIndex>[src]

pub fn signatures(&self) -> &[Signature][src]

pub fn get_module_signature(&self) -> &[u8][src]

pub fn features(&self) -> &ModuleFeatures[src]

pub fn patch_module_signature(
    module_data_bin: &'a [u8],
    module_signature: &[u8]
) -> Result<Vec<u8>, Error>
[src]

pub fn clear_module_signature(
    module_data_bin: &'a [u8]
) -> Result<Vec<u8>, Error>
[src]

pub fn serialize(&self) -> Result<Vec<u8>, Error>[src]

Serialize to bincode.

pub fn deserialize(buf: &'a [u8]) -> Result<ModuleData<'a>, Error>[src]

Deserialize from bincode.

Trait Implementations

impl<'a> Debug for ModuleData<'a>[src]

impl<'de: 'a, 'a> Deserialize<'de> for ModuleData<'a>[src]

impl<'a> Serialize for ModuleData<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for ModuleData<'a>

impl<'a> Send for ModuleData<'a>

impl<'a> Sync for ModuleData<'a>

impl<'a> Unpin for ModuleData<'a>

impl<'a> UnwindSafe for ModuleData<'a>

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.