pub struct PluginMemory {
    pub store: Store<Internal>,
    pub memory: Memory,
    pub live_blocks: BTreeMap<usize, usize>,
    pub free: Vec<MemoryBlock>,
    pub position: usize,
}
Expand description

Handles memory for plugins

Fields§

§store: Store<Internal>§memory: Memory§live_blocks: BTreeMap<usize, usize>§free: Vec<MemoryBlock>§position: usize

Implementations§

Create memory for a plugin

Write slice to memory

Read slice from memory

Size of memory in bytes

Size of memory in pages

Reserve n bytes of memory

Allocate and copy data into the wasm memory

Free the block allocated at offset

Log entire memory as hexdump using the trace log level

Reset memory - clears free-list and live blocks and resets position

Get memory as a slice of bytes

Get memory as a mutable slice of bytes

Get bytes occupied by the provided memory handle

Get mutable bytes occupied by the provided memory handle

Get str occupied by the provided memory handle

Get mutable str occupied by the provided memory handle

Pointer to the provided memory handle

Get the length of the block starting at offs

Get the block at the specified offset

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Query the “status” flags for the self file descriptor.
Create a new SetFdFlags value for use with set_fd_flags. Read more
Set the “status” flags for the self file descriptor. Read more
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more