Struct wiggle_borrow::BorrowChecker[][src]

pub struct BorrowChecker { /* fields omitted */ }

Implementations

impl BorrowChecker[src]

pub fn new() -> Self[src]

A BorrowChecker manages run-time validation of borrows from a GuestMemory. It keeps track of regions of guest memory which are possible to alias with Rust references (via the GuestSlice and GuestStr structs, which implement std::ops::Deref and std::ops::DerefMut. It also enforces that GuestPtr::read does not access memory with an outstanding mutable borrow, and GuestPtr::write does not access memory with an outstanding shared or mutable borrow.

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

Indicates whether any outstanding shared or mutable borrows are known to the BorrowChecker. 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.

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

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

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

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

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

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

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>[src]

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

fn in_current_span(self) -> Instrumented<Self>[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.