Struct wiggle::borrow::BorrowChecker
source · [−]pub struct BorrowChecker { /* private fields */ }
Implementations
sourceimpl BorrowChecker
impl BorrowChecker
sourcepub fn new() -> Self
pub fn new() -> Self
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.
sourcepub fn has_outstanding_borrows(&self) -> bool
pub fn has_outstanding_borrows(&self) -> bool
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 mut_borrow(&self, r: Region) -> Result<BorrowHandle, GuestError>
pub fn mut_unborrow(&self, h: BorrowHandle)
pub fn is_mut_borrowed(&self, r: Region) -> bool
Auto Trait Implementations
impl RefUnwindSafe for BorrowChecker
impl Send for BorrowChecker
impl Sync for BorrowChecker
impl Unpin for BorrowChecker
impl UnwindSafe for BorrowChecker
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more