Struct wasmtime_wiggle::WasmtimeGuestMemory[][src]

pub struct WasmtimeGuestMemory { /* fields omitted */ }
Expand description

Lightweight wasmtime::Memory wrapper so we can implement the wiggle::GuestMemory trait on it.

Implementations

impl WasmtimeGuestMemory[src]

pub fn new(mem: Memory) -> Self[src]

Trait Implementations

impl GuestMemory for WasmtimeGuestMemory[src]

fn base(&self) -> (*mut u8, u32)[src]

Returns the base allocation of this guest memory, located in host memory. Read more

fn has_outstanding_borrows(&self) -> bool[src]

Indicates whether any outstanding borrows are known to the GuestMemory. This function must be false in order for it to be safe to recursively call into a WebAssembly module, or to manipulate the WebAssembly memory by any other means. Read more

fn is_shared_borrowed(&self, r: Region) -> bool[src]

Check if a region of linear memory has any shared borrows.

fn is_mut_borrowed(&self, r: Region) -> bool[src]

Check if a region of linear memory is exclusively borrowed. This is called during any GuestPtr::read or GuestPtr::write operation to ensure that wiggle is not reading or writing a region of memory which Rust believes it has exclusive access to. Read more

fn shared_borrow(&self, r: Region) -> Result<BorrowHandle, GuestError>[src]

Shared borrow a region of linear memory. This is used when constructing a GuestSlice or GuestStr. Those types will give Rust & (shared reference) access to the region of linear memory. Read more

fn mut_borrow(&self, r: Region) -> Result<BorrowHandle, GuestError>[src]

Exclusively borrow a region of linear memory. This is used when constructing a GuestSliceMut or GuestStrMut. Those types will give Rust &mut access to the region of linear memory, therefore, the GuestMemory impl must guarantee that at most one BorrowHandle is issued to a given region, GuestMemory::has_outstanding_borrows is true for the duration of the borrow, and that GuestMemory::is_mut_borrowed of any overlapping region is false for the duration of the borrow. Read more

fn shared_unborrow(&self, h: BorrowHandle)[src]

Unborrow a previously borrowed shared region. As long as GuestSlice and GuestStr are implemented correctly, a shared BorrowHandle should only be unborrowed once. Read more

fn mut_unborrow(&self, h: BorrowHandle)[src]

Unborrow a previously borrowed mutable region. As long as GuestSliceMut and GuestStrMut are implemented correctly, a mut BorrowHandle should only be unborrowed once. Read more

fn validate_size_align(
    &self,
    offset: u32,
    align: usize,
    len: u32
) -> Result<*mut u8, GuestError>
[src]

Validates a guest-relative pointer given various attributes, and returns the corresponding host pointer. Read more

fn ptr<T>(&'a self, offset: <T as Pointee>::Pointer) -> GuestPtr<'a, T> where
    T: Pointee + ?Sized
[src]

Convenience method for creating a GuestPtr at a particular offset. Read more

Auto Trait Implementations

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>

Notable traits for Instrumented<T>

impl<T> Future for Instrumented<T> where
    T: Future
type Output = <T as Future>::Output;
[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>

Notable traits for Instrumented<T>

impl<T> Future for Instrumented<T> where
    T: Future
type Output = <T as Future>::Output;
[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Pointee for T[src]

type Pointer = u32

pub fn debug(
    pointer: <T as Pointee>::Pointer,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V