[][src]Struct holochain_core::nucleus::ribosome::memory::SinglePageManager

pub struct SinglePageManager { /* fields omitted */ }

Struct for managing a WASM Memory Instance as a single page memory stack

Methods

impl SinglePageManager
[src]

A Memory Manager limited to one wasm memory page that works like a stack. With this Memory Manager, the WASM host (i.e. the Ribosome) and WASM module (i.e. the Zome) only need to pass around an i32 to communicate any data. That i32 is the last memory allocation on the stack: it is split in an i16 'offset' in the upper bits and an i16 'length' in the lower bits. This fits with the 64KiB sized of a memory Page. Complex input arguments should be stored on the latest allocation on the stack. Complex output arguments can be stored anywhere on stack. Since zero sized allocations are not allowed, it is possible to pass around a return and/or error code with the following convention: using the i16 'offset' as return code and i16 'length' set to zero to indicate its a return code. Return code of 0 means success, while any other value means a failure and gives the error code. In the future, to handle bigger memory needs, we could do same with an i64 instead and handle multiple memory Pages.

Allocate on stack without writing in it

Write data on top of stack

Read data somewhere in stack

Trait Implementations

impl Clone for SinglePageManager
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for SinglePageManager
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl !Send for SinglePageManager

impl !Sync for SinglePageManager

Blanket Implementations

impl<T> From for T
[src]

Performs the conversion.

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

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

Immutably borrows from an owned value. Read more

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

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

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

Mutably borrows from an owned value. Read more

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Same for T
[src]

Should always be Self