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.
Registers a new shared container 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<&SharedContainer>
pub fn get_reference( &self, pointer_address: &PointerAddress, ) -> Option<&SharedContainer>
Returns a reference stored at the given PointerAddress, if it exists.
pub fn get_value_reference( &self, pointer_address: &PointerAddress, ) -> Option<&Rc<RefCell<SharedValueContainer>>>
pub fn get_type_reference( &self, pointer_address: &PointerAddress, ) -> Option<&Rc<RefCell<SharedTypeContainer>>>
Sourcepub fn get_core_reference(
&self,
pointer_id: CoreLibPointerId,
) -> &SharedContainer
pub fn get_core_reference( &self, pointer_id: CoreLibPointerId, ) -> &SharedContainer
Helper function to get a core value directly from memory
Sourcepub fn get_core_type_reference(
&self,
pointer_id: CoreLibPointerId,
) -> Result<Rc<RefCell<SharedTypeContainer>>, IllegalTypeError>
pub fn get_core_type_reference( &self, pointer_id: CoreLibPointerId, ) -> Result<Rc<RefCell<SharedTypeContainer>>, 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<SharedTypeContainer>>
pub fn get_core_type_reference_unchecked( &self, pointer_id: CoreLibPointerId, ) -> Rc<RefCell<SharedTypeContainer>>
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: RawRemotePointerAddress,
) -> PointerAddress
pub fn get_pointer_address_from_raw_full_address( &self, raw_address: RawRemotePointerAddress, ) -> 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_owned_local_pointer(&mut self) -> Pointer
pub fn get_new_owned_local_pointer(&mut self) -> Pointer
Creates a new unique local owned pointer.
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 UnsafeUnpin for Memory
impl !UnwindSafe for Memory
Blanket Implementations§
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> 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