pub struct Memory { /* private fields */ }Implementations§
Source§impl Memory
impl Memory
Sourcepub fn new(endpoint: Endpoint) -> Memory
pub fn new(endpoint: Endpoint) -> Memory
Creates a new, Memory instance with the core library loaded.
Sourcepub fn register_reference(&mut self, reference: &Reference) -> PointerAddress
pub fn register_reference(&mut self, reference: &Reference) -> PointerAddress
Registers a new reference in memory. If the reference has no PointerAddress, a new local one is generated. If the reference is already registered (has a PointerAddress), the existing address is returned and no new registration is done. Returns the PointerAddress of the registered reference.
Sourcepub fn get_reference(
&self,
pointer_address: &PointerAddress,
) -> Option<&Reference>
pub fn get_reference( &self, pointer_address: &PointerAddress, ) -> Option<&Reference>
Returns a reference stored at the given PointerAddress, if it exists.
pub fn get_value_reference( &self, pointer_address: &PointerAddress, ) -> Option<&Rc<RefCell<ValueReference>>>
pub fn get_type_reference( &self, pointer_address: &PointerAddress, ) -> Option<&Rc<RefCell<TypeReference>>>
Sourcepub fn get_core_reference(&self, pointer_id: CoreLibPointerId) -> &Reference
pub fn get_core_reference(&self, pointer_id: CoreLibPointerId) -> &Reference
Helper function to get a core value directly from memory
Sourcepub fn get_core_type_reference(
&self,
pointer_id: CoreLibPointerId,
) -> Result<Rc<RefCell<TypeReference>>, IllegalTypeError>
pub fn get_core_type_reference( &self, pointer_id: CoreLibPointerId, ) -> Result<Rc<RefCell<TypeReference>>, IllegalTypeError>
Helper function to get a core type directly from memory if it can be used as a type
Sourcepub fn get_core_type_reference_unchecked(
&self,
pointer_id: CoreLibPointerId,
) -> Rc<RefCell<TypeReference>>
pub fn get_core_type_reference_unchecked( &self, pointer_id: CoreLibPointerId, ) -> Rc<RefCell<TypeReference>>
Helper function to get a core type directly from memory, asserting that is can be used as a type Panics if the core type is not found or cannot be used as a type.
Sourcepub fn get_pointer_address_from_raw_full_address(
&self,
raw_address: RawFullPointerAddress,
) -> PointerAddress
pub fn get_pointer_address_from_raw_full_address( &self, raw_address: RawFullPointerAddress, ) -> PointerAddress
Takes a RawFullPointerAddress and converts it to a PointerAddress::Local or PointerAddress::Remote, depending on whether the pointer origin id matches the local endpoint.
Sourcepub fn get_new_local_address(&mut self) -> PointerAddress
pub fn get_new_local_address(&mut self) -> PointerAddress
Creates a new unique local PointerAddress.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Memory
impl !RefUnwindSafe for Memory
impl !Send for Memory
impl !Sync for Memory
impl Unpin for Memory
impl !UnwindSafe for Memory
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more