Skip to main content

Memory

Struct Memory 

Source
pub struct Memory { /* private fields */ }

Implementations§

Source§

impl Memory

Source

pub fn new(endpoint: Endpoint) -> Memory

Creates a new, Memory instance with the core library loaded.

Source

pub fn register_shared_container(&mut self, reference: &SharedContainer)

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.

Source

pub fn get_reference( &self, pointer_address: &PointerAddress, ) -> Option<&SharedContainer>

Returns a reference stored at the given PointerAddress, if it exists.

Source

pub fn get_value_reference( &self, pointer_address: &PointerAddress, ) -> Option<&Rc<RefCell<SharedValueContainer>>>

Source

pub fn get_type_reference( &self, pointer_address: &PointerAddress, ) -> Option<&Rc<RefCell<SharedTypeContainer>>>

Source

pub fn get_core_reference( &self, pointer_id: CoreLibPointerId, ) -> &SharedContainer

Helper function to get a core value directly from memory

Source

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

Source

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.

Source

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.

Source

pub fn get_new_owned_local_pointer(&mut self) -> Pointer

Creates a new unique local owned pointer.

Trait Implementations§

Source§

impl Debug for Memory

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Memory

Source§

fn default() -> Memory

Returns the “default value” for a type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.