Skip to content

Commit

Permalink
Merge pull request #3 from wasmerio/docs
Browse files Browse the repository at this point in the history
Fix errors in run of `cargo doc`.
  • Loading branch information
nlewycky authored Apr 29, 2020
2 parents c57d509 + 61aee6c commit d827c7f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
12 changes: 10 additions & 2 deletions lib/api/src/exports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ use wasmer_runtime::Export;
/// The `ExportError` can happen when trying to get a specific
/// export [`Extern`] from the [`Instance`] exports.
///
/// [`Instance`]: crate::Instance
///
/// ```ignore
/// # let my_instance = Instance::new(...);
///
Expand Down Expand Up @@ -146,12 +148,18 @@ impl LikeNamespace for Exports {
}

/// This trait is used to mark types as gettable from an [`Instance`].
///
/// [`Instance`]: crate::Instance
pub trait Exportable<'a>: Sized {
/// This function is used when providedd the Extern as exportable, so it
/// can be used while instantiating the Module.
/// This function is used when providedd the [`Extern`] as exportable, so it
/// can be used while instantiating the [`Module`].
///
/// [`Module`]: crate::Module
fn to_export(&self) -> Export;

/// Implementation of how to get the export corresponding to the implementing type
/// from an [`Instance`] by name.
///
/// [`Instance`]: crate::Instance
fn get_self_from_extern(_extern: &'a Extern) -> Result<&'a Self, ExportError>;
}
4 changes: 3 additions & 1 deletion lib/api/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ impl Instance {
///
/// The [`ImportObject`] is the easiest way to provide imports to the instance.
///
/// [`ImportObject`]: crate::ImportObject
///
/// ```
/// # use wasmer::{imports, Store, Module, Global, Instance};
/// let store = Store::default();
Expand All @@ -43,7 +45,7 @@ impl Instance {
///
/// ## Errors
///
/// The function can return [`InstantiationErrors`].
/// The function can return [`InstantiationError`]s.
///
/// Those are, as defined by the spec:
/// * Link errors that happen when plugging the imports into the instance
Expand Down
2 changes: 1 addition & 1 deletion lib/api/src/ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ impl<T: Copy + ValueType> WasmPtr<T, Array> {
/// Get a UTF-8 string from the `WasmPtr`, where the string is nul-terminated.
///
/// Note that this does not account for UTF-8 strings that _contain_ nul themselves,
/// [`get_utf8_string`] has to be used for those.
/// [`WasmPtr::get_utf8_string`] has to be used for those.
///
/// Also note that this method returns a reference to Wasm linear memory. The
/// underlying data can be mutated if the Wasm is allowed to execute or
Expand Down

0 comments on commit d827c7f

Please sign in to comment.