mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-06 20:58:28 +00:00
doc: Fix links.
Since the `intra-doc-links` feature has been stabilized, we can see more clearly that we have many broken links. This PR is an attempt to fix them!
This commit is contained in:
5
lib/api/src/externals/memory.rs
vendored
5
lib/api/src/externals/memory.rs
vendored
@@ -32,9 +32,8 @@ pub struct Memory {
|
|||||||
impl Memory {
|
impl Memory {
|
||||||
/// Creates a new host `Memory` from the provided [`MemoryType`].
|
/// Creates a new host `Memory` from the provided [`MemoryType`].
|
||||||
///
|
///
|
||||||
/// This function will construct the `Memory` using the store [`Tunables`].
|
/// This function will construct the `Memory` using the store
|
||||||
///
|
/// [`BaseTunables`][crate::tunables::BaseTunables].
|
||||||
/// [`Tunables`]: crate::tunables::Tunables
|
|
||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
|
|||||||
5
lib/api/src/externals/table.rs
vendored
5
lib/api/src/externals/table.rs
vendored
@@ -36,9 +36,8 @@ impl Table {
|
|||||||
///
|
///
|
||||||
/// All the elements in the table will be set to the `init` value.
|
/// All the elements in the table will be set to the `init` value.
|
||||||
///
|
///
|
||||||
/// This function will construct the `Table` using the store [`Tunables`].
|
/// This function will construct the `Table` using the store
|
||||||
///
|
/// [`BaseTunables`][crate::tunables::BaseTunables].
|
||||||
/// [`Tunables`]: crate::tunables::Tunables
|
|
||||||
pub fn new(store: &Store, ty: TableType, init: Val) -> Result<Self, RuntimeError> {
|
pub fn new(store: &Store, ty: TableType, init: Val) -> Result<Self, RuntimeError> {
|
||||||
let item = init.into_checked_anyfunc(store)?;
|
let item = init.into_checked_anyfunc(store)?;
|
||||||
let tunables = store.tunables();
|
let tunables = store.tunables();
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ pub enum OptLevel {
|
|||||||
SpeedAndSize,
|
SpeedAndSize,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Global configuration options used to create an [`Engine`] and customize its
|
/// Global configuration options used to create an
|
||||||
/// behavior.
|
/// `wasmer_engine::Engine` and customize its behavior.
|
||||||
///
|
///
|
||||||
/// This structure exposed a builder-like interface and is primarily consumed by
|
/// This structure exposed a builder-like interface and is primarily
|
||||||
/// [`Engine::new()`]
|
/// consumed by `wasmer_engine::Engine::new`.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct Cranelift {
|
pub struct Cranelift {
|
||||||
enable_nan_canonicalization: bool,
|
enable_nan_canonicalization: bool,
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ pub enum WasmError {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The error that can happen while parsing a `str`
|
/// The error that can happen while parsing a `str`
|
||||||
/// to retrieve a [`CpuFeature`].
|
/// to retrieve a [`CpuFeature`](crate::target::CpuFeature).
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
#[cfg_attr(feature = "std", derive(Error))]
|
#[cfg_attr(feature = "std", derive(Error))]
|
||||||
pub enum ParseCpuFeatureError {
|
pub enum ParseCpuFeatureError {
|
||||||
|
|||||||
@@ -82,8 +82,8 @@ pub type CustomSections = PrimaryMap<SectionIndex, CustomSection>;
|
|||||||
#[derive(Debug, PartialEq, Eq, Clone)]
|
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||||
pub struct Dwarf {
|
pub struct Dwarf {
|
||||||
/// The section index in the [`Compilation`] that corresponds to the exception frames.
|
/// The section index in the [`Compilation`] that corresponds to the exception frames.
|
||||||
/// More info:
|
/// [Learn
|
||||||
/// https://refspecs.linuxfoundation.org/LSB_3.0.0/LSB-PDA/LSB-PDA/ehframechpt.html
|
/// more](https://refspecs.linuxfoundation.org/LSB_3.0.0/LSB-PDA/LSB-PDA/ehframechpt.html).
|
||||||
pub eh_frame: SectionIndex,
|
pub eh_frame: SectionIndex,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
//! to another part of a program (or a different program that may have
|
//! to another part of a program (or a different program that may have
|
||||||
//! been dynamically loaded) using a table of branch or jump instructions.
|
//! been dynamically loaded) using a table of branch or jump instructions.
|
||||||
//!
|
//!
|
||||||
//! Source: https://en.wikipedia.org/wiki/Branch_table
|
//! [Learn more](https://en.wikipedia.org/wiki/Branch_table).
|
||||||
|
|
||||||
use super::CodeOffset;
|
use super::CodeOffset;
|
||||||
#[cfg(feature = "enable-serde")]
|
#[cfg(feature = "enable-serde")]
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
//! code and data of a program and adjusting the code and data to reflect the
|
//! code and data of a program and adjusting the code and data to reflect the
|
||||||
//! assigned addresses.
|
//! assigned addresses.
|
||||||
//!
|
//!
|
||||||
//! Source: https://en.wikipedia.org/wiki/Relocation_(computing)
|
//! [Learn more](https://en.wikipedia.org/wiki/Relocation_(computing)).
|
||||||
//!
|
//!
|
||||||
//! Each time a `Compiler` compiles a WebAssembly function (into machine code),
|
//! Each time a `Compiler` compiles a WebAssembly function (into machine code),
|
||||||
//! it also attaches if there are any relocations that need to be patched into
|
//! it also attaches if there are any relocations that need to be patched into
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
//! called the function that threw the exception, and which
|
//! called the function that threw the exception, and which
|
||||||
//! function called that one, and so forth.
|
//! function called that one, and so forth.
|
||||||
//!
|
//!
|
||||||
//! More info: https://en.wikipedia.org/wiki/Call_stack
|
//! [Learn more](https://en.wikipedia.org/wiki/Call_stack).
|
||||||
use crate::lib::std::vec::Vec;
|
use crate::lib::std::vec::Vec;
|
||||||
#[cfg(feature = "enable-serde")]
|
#[cfg(feature = "enable-serde")]
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|||||||
@@ -292,13 +292,14 @@ pub fn register(
|
|||||||
Some(GlobalFrameInfoRegistration { key: max })
|
Some(GlobalFrameInfoRegistration { key: max })
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Description of a frame in a backtrace for a [`Trap`].
|
/// Description of a frame in a backtrace for a [`RuntimeError::trace`](crate::RuntimeError::trace).
|
||||||
///
|
///
|
||||||
/// Whenever a WebAssembly trap occurs an instance of [`Trap`] is created. Each
|
/// Whenever a WebAssembly trap occurs an instance of [`RuntimeError`]
|
||||||
/// [`Trap`] has a backtrace of the WebAssembly frames that led to the trap, and
|
/// is created. Each [`RuntimeError`] has a backtrace of the
|
||||||
/// each frame is described by this structure.
|
/// WebAssembly frames that led to the trap, and each frame is
|
||||||
|
/// described by this structure.
|
||||||
///
|
///
|
||||||
/// [`Trap`]: crate::Trap
|
/// [`RuntimeError`]: crate::RuntimeError
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct FrameInfo {
|
pub struct FrameInfo {
|
||||||
module_name: String,
|
module_name: String,
|
||||||
|
|||||||
@@ -65,6 +65,8 @@ impl InstanceAllocator {
|
|||||||
/// correspond to the location in memory for the local memories and
|
/// correspond to the location in memory for the local memories and
|
||||||
/// tables respectively. These pointers should be written to before
|
/// tables respectively. These pointers should be written to before
|
||||||
/// calling [`InstanceHandle::new`].
|
/// calling [`InstanceHandle::new`].
|
||||||
|
///
|
||||||
|
/// [`InstanceHandle::new`]: super::InstanceHandle::new
|
||||||
pub fn new(
|
pub fn new(
|
||||||
module: &ModuleInfo,
|
module: &ModuleInfo,
|
||||||
) -> (
|
) -> (
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
// This file contains code from external sources.
|
// This file contains code from external sources.
|
||||||
// Attributions: https://github.com/wasmerio/wasmer/blob/master/ATTRIBUTIONS.md
|
// Attributions: https://github.com/wasmerio/wasmer/blob/master/ATTRIBUTIONS.md
|
||||||
|
|
||||||
//! Data structure for representing WebAssembly modules
|
//! Data structure for representing WebAssembly modules in a
|
||||||
//! in a [`Module`].
|
//! `wasmer::Module`.
|
||||||
|
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ mod test_vmfunction_body {
|
|||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub enum VMFunctionKind {
|
pub enum VMFunctionKind {
|
||||||
/// A static function has the native signature:
|
/// A static function has the native signature:
|
||||||
/// extern "C" (vmctx, arg1, arg2...) -> (result1, result2, ...)
|
/// `extern "C" (vmctx, arg1, arg2...) -> (result1, result2, ...)`.
|
||||||
///
|
///
|
||||||
/// This is the default for functions that are defined:
|
/// This is the default for functions that are defined:
|
||||||
/// 1. In the Host, natively
|
/// 1. In the Host, natively
|
||||||
@@ -172,7 +172,7 @@ pub enum VMFunctionKind {
|
|||||||
Static,
|
Static,
|
||||||
|
|
||||||
/// A dynamic function has the native signature:
|
/// A dynamic function has the native signature:
|
||||||
/// extern "C" (ctx, &[Value]) -> Vec<Value>
|
/// `extern "C" (ctx, &[Value]) -> Vec<Value>`.
|
||||||
///
|
///
|
||||||
/// This is the default for functions that are defined:
|
/// This is the default for functions that are defined:
|
||||||
/// 1. In the Host, dynamically
|
/// 1. In the Host, dynamically
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
//! WARNING: the API exposed here is unstable and very experimental. Certain things are not ready
|
//! WARNING: the API exposed here is unstable and very experimental. Certain things are not ready
|
||||||
//! yet and may be broken in patch releases. If you're using this and have any specific needs,
|
//! yet and may be broken in patch releases. If you're using this and have any specific needs,
|
||||||
//! please let us know here https://github.com/wasmerio/wasmer/issues/583 or by filing an issue.
|
//! please [let us know here](https://github.com/wasmerio/wasmer/issues/583) or by filing an issue.
|
||||||
//!
|
//!
|
||||||
//! Wasmer always has a virtual root directory located at `/` at which all pre-opened directories can
|
//! Wasmer always has a virtual root directory located at `/` at which all pre-opened directories can
|
||||||
//! be found. It's possible to traverse between preopened directories this way as well (for example
|
//! be found. It's possible to traverse between preopened directories this way as well (for example
|
||||||
@@ -539,7 +539,7 @@ impl WasiFs {
|
|||||||
/// # Safety
|
/// # Safety
|
||||||
/// - Virtual directories created with this function must not conflict with
|
/// - Virtual directories created with this function must not conflict with
|
||||||
/// the standard operation of the WASI filesystem. This is vague and
|
/// the standard operation of the WASI filesystem. This is vague and
|
||||||
/// unlikely in pratice. Join the discussion at https://github.com/wasmerio/wasmer/issues/1219
|
/// unlikely in pratice. [Join the discussion](https://github.com/wasmerio/wasmer/issues/1219)
|
||||||
/// for what the newer, safer WASI FS APIs should look like.
|
/// for what the newer, safer WASI FS APIs should look like.
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub unsafe fn open_dir_all(
|
pub unsafe fn open_dir_all(
|
||||||
|
|||||||
@@ -359,9 +359,9 @@ pub struct GlobalType {
|
|||||||
|
|
||||||
/// A WebAssembly global descriptor.
|
/// A WebAssembly global descriptor.
|
||||||
///
|
///
|
||||||
/// This type describes an instance of a global in a WebAssembly module. Globals
|
/// This type describes an instance of a global in a WebAssembly
|
||||||
/// are local to an [`Instance`](crate::Instance) and are either immutable or
|
/// module. Globals are local to an `Instance` and are either
|
||||||
/// mutable.
|
/// immutable or mutable.
|
||||||
impl GlobalType {
|
impl GlobalType {
|
||||||
/// Create a new Global variable
|
/// Create a new Global variable
|
||||||
/// # Usage:
|
/// # Usage:
|
||||||
@@ -520,10 +520,10 @@ impl fmt::Display for MemoryType {
|
|||||||
|
|
||||||
/// A descriptor for an imported value into a wasm module.
|
/// A descriptor for an imported value into a wasm module.
|
||||||
///
|
///
|
||||||
/// This type is primarily accessed from the
|
/// This type is primarily accessed from the `Module::imports`
|
||||||
/// [`Module::imports`](crate::Module::imports) API. Each [`ImportType`]
|
/// API. Each `ImportType` describes an import into the wasm module
|
||||||
/// describes an import into the wasm module with the module/name that it's
|
/// with the module/name that it's imported from as well as the type
|
||||||
/// imported from as well as the type of item that's being imported.
|
/// of item that's being imported.
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||||
#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]
|
#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]
|
||||||
pub struct ImportType<T = ExternType> {
|
pub struct ImportType<T = ExternType> {
|
||||||
@@ -564,10 +564,9 @@ impl<T> ImportType<T> {
|
|||||||
|
|
||||||
/// A descriptor for an exported WebAssembly value.
|
/// A descriptor for an exported WebAssembly value.
|
||||||
///
|
///
|
||||||
/// This type is primarily accessed from the
|
/// This type is primarily accessed from the `Module::exports`
|
||||||
/// [`Module::exports`](crate::Module::exports) accessor and describes what
|
/// accessor and describes what names are exported from a wasm module
|
||||||
/// names are exported from a wasm module and the type of the item that is
|
/// and the type of the item that is exported.
|
||||||
/// exported.
|
|
||||||
///
|
///
|
||||||
/// The `<T>` refefers to `ExternType`, however it can also refer to use
|
/// The `<T>` refefers to `ExternType`, however it can also refer to use
|
||||||
/// `MemoryType`, `TableType`, `FunctionType` and `GlobalType` for ease of
|
/// `MemoryType`, `TableType`, `FunctionType` and `GlobalType` for ease of
|
||||||
|
|||||||
Reference in New Issue
Block a user