Skip to main content

RuntimeInternal

Struct RuntimeInternal 

Source
pub struct RuntimeInternal {
    pub memory: RefCell<Memory>,
    pub com_hub: Rc<ComHub>,
    pub endpoint: Endpoint,
    pub config: RuntimeConfig,
    pub task_manager: TaskManager,
    pub execution_contexts: RefCell<HashMap<IncomingEndpointContextSectionId, ExecutionContext>>,
    /* private fields */
}

Fields§

§memory: RefCell<Memory>§com_hub: Rc<ComHub>§endpoint: Endpoint§config: RuntimeConfig§task_manager: TaskManager§execution_contexts: RefCell<HashMap<IncomingEndpointContextSectionId, ExecutionContext>>

active execution contexts, stored by context_id

Implementations§

Source§

impl RuntimeInternal

Source

pub fn stub() -> RuntimeInternal

Source

pub fn execute_dxb<'a>( self_rc: Rc<RuntimeInternal>, dxb: Vec<u8>, execution_context: Option<&'a mut ExecutionContext>, _end_execution: bool, ) -> Pin<Box<dyn Future<Output = Result<Option<ValueContainer>, ExecutionError>> + 'a>>

Source

pub fn execute_dxb_sync( self_rc: Rc<RuntimeInternal>, dxb: &[u8], execution_context: Option<&mut ExecutionContext>, _end_execution: bool, ) -> Result<Option<ValueContainer>, ExecutionError>

Source

pub async fn execute_remote( self_rc: Rc<RuntimeInternal>, remote_execution_context: &mut RemoteExecutionContext, dxb: Vec<u8>, ) -> Result<Option<ValueContainer>, ExecutionError>

Source

pub fn get_env(&self) -> HashMap<String, String>

Trait Implementations§

Source§

impl DIFInterface for RuntimeInternal

Source§

fn update( &self, source_id: TransceiverId, address: PointerAddress, update: &DIFUpdateData, ) -> Result<(), DIFUpdateError>

Applies a DIF update to the value at the given pointer address.
Source§

fn apply( &self, _callee: DIFValueContainer, _value: DIFValueContainer, ) -> Result<DIFValueContainer, DIFApplyError>

Executes an apply operation, applying the value to the callee.
Source§

fn create_pointer( &self, value: DIFValueContainer, allowed_type: Option<DIFTypeDefinition>, mutability: SharedContainerMutability, ) -> Result<PointerAddress, DIFCreatePointerError>

Creates a new pointer and stores it in memory. Returns the address of the newly created pointer.
Source§

async fn resolve_pointer_address_external( &self, address: PointerAddress, ) -> Result<DIFReference, DIFResolveReferenceError>

Resolves a pointer address of a pointer that may not be in memory. If the pointer is not in memory, it will be loaded from external storage.
Source§

fn resolve_pointer_address_in_memory( &self, address: PointerAddress, ) -> Result<DIFReference, DIFResolveReferenceError>

Resolves a pointer address of a pointer that is currently in memory. Returns an error if the pointer is not found in memory.
Source§

fn observe_pointer( &self, transceiver_id: TransceiverId, address: PointerAddress, options: ObserveOptions, callback: impl Fn(&DIFUpdateData, TransceiverId) + 'static, ) -> Result<u32, DIFObserveError>

Starts observing changes to the pointer at the given address. As long as the pointer is observed, it will not be garbage collected.
Source§

fn update_observer_options( &self, address: PointerAddress, observer_id: u32, options: ObserveOptions, ) -> Result<(), DIFObserveError>

Updates the options for an existing observer on the pointer at the given address. If the observer does not exist, an error is returned.
Source§

fn unobserve_pointer( &self, address: PointerAddress, observer_id: u32, ) -> Result<(), DIFObserveError>

Stops observing changes to the pointer at the given address. If no other references to the pointer exist, it may be garbage collected after this call.
Source§

impl Debug for RuntimeInternal

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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.