pub struct NodeRuntimeAdapter<'a, R: DeclaredNodeRuntime + ?Sized, const MAX_NODES: usize = { crate::node_metadata::DEFAULT_MAX_METADATA_NODES }, const MAX_ENTITIES: usize = { crate::node_metadata::DEFAULT_MAX_METADATA_ENTITIES }, const MAX_CALLBACKS: usize = { crate::node_metadata::DEFAULT_MAX_METADATA_CALLBACKS }> { /* private fields */ }Expand description
Runtime adapter used by generated main ownership code.
Implementations§
Source§impl<'a, R: DeclaredNodeRuntime + ?Sized, const MAX_NODES: usize, const MAX_ENTITIES: usize, const MAX_CALLBACKS: usize> NodeRuntimeAdapter<'a, R, MAX_NODES, MAX_ENTITIES, MAX_CALLBACKS>
impl<'a, R: DeclaredNodeRuntime + ?Sized, const MAX_NODES: usize, const MAX_ENTITIES: usize, const MAX_CALLBACKS: usize> NodeRuntimeAdapter<'a, R, MAX_NODES, MAX_ENTITIES, MAX_CALLBACKS>
Sourcepub fn new(node_runtime: &'a mut R) -> Self
pub fn new(node_runtime: &'a mut R) -> Self
Build a runtime adapter around a generated executor owner.
Sourcepub fn nodes(&self) -> &[RuntimeNodeRecord<R::NodeHandle>]
pub fn nodes(&self) -> &[RuntimeNodeRecord<R::NodeHandle>]
Runtime node mappings in declaration order.
Sourcepub fn entities(&self) -> &[EntityMetadata]
pub fn entities(&self) -> &[EntityMetadata]
Entity declarations accepted for generated runtime binding.
Sourcepub fn callback_effects(&self) -> &[CallbackEffectMetadata]
pub fn callback_effects(&self) -> &[CallbackEffectMetadata]
Optional callback effects accepted for generated runtime binding.
Sourcepub fn node_handle(&self, stable_id: NodeId<'_>) -> Option<R::NodeHandle>
pub fn node_handle(&self, stable_id: NodeId<'_>) -> Option<R::NodeHandle>
Lookup an executor node handle by stable component node ID.
Trait Implementations§
Source§impl<R: DeclaredNodeRuntime + ?Sized, const MAX_NODES: usize, const MAX_ENTITIES: usize, const MAX_CALLBACKS: usize> NodeRuntime for NodeRuntimeAdapter<'_, R, MAX_NODES, MAX_ENTITIES, MAX_CALLBACKS>
impl<R: DeclaredNodeRuntime + ?Sized, const MAX_NODES: usize, const MAX_ENTITIES: usize, const MAX_CALLBACKS: usize> NodeRuntime for NodeRuntimeAdapter<'_, R, MAX_NODES, MAX_ENTITIES, MAX_CALLBACKS>
Source§fn create_node(
&mut self,
id: NodeId<'_>,
options: NodeOptions<'_>,
) -> NodeResult<()>
fn create_node( &mut self, id: NodeId<'_>, options: NodeOptions<'_>, ) -> NodeResult<()>
Declare a component node.
Source§fn create_entity(&mut self, metadata: EntityMetadata) -> NodeResult<()>
fn create_entity(&mut self, metadata: EntityMetadata) -> NodeResult<()>
Declare a publisher, subscription, timer, service, action, or parameter.
Source§fn record_callback_effect(
&mut self,
callback_id: CallbackId<'_>,
kind: CallbackEffectKind,
entity_id: EntityId<'_>,
) -> NodeResult<()>
fn record_callback_effect( &mut self, callback_id: CallbackId<'_>, kind: CallbackEffectKind, entity_id: EntityId<'_>, ) -> NodeResult<()>
Add optional callback effect metadata.
Auto Trait Implementations§
impl<'a, R, const MAX_NODES: usize, const MAX_ENTITIES: usize, const MAX_CALLBACKS: usize> Freeze for NodeRuntimeAdapter<'a, R, MAX_NODES, MAX_ENTITIES, MAX_CALLBACKS>
impl<'a, R, const MAX_NODES: usize, const MAX_ENTITIES: usize, const MAX_CALLBACKS: usize> RefUnwindSafe for NodeRuntimeAdapter<'a, R, MAX_NODES, MAX_ENTITIES, MAX_CALLBACKS>
impl<'a, R, const MAX_NODES: usize, const MAX_ENTITIES: usize, const MAX_CALLBACKS: usize> Send for NodeRuntimeAdapter<'a, R, MAX_NODES, MAX_ENTITIES, MAX_CALLBACKS>
impl<'a, R, const MAX_NODES: usize, const MAX_ENTITIES: usize, const MAX_CALLBACKS: usize> Sync for NodeRuntimeAdapter<'a, R, MAX_NODES, MAX_ENTITIES, MAX_CALLBACKS>
impl<'a, R, const MAX_NODES: usize, const MAX_ENTITIES: usize, const MAX_CALLBACKS: usize> Unpin for NodeRuntimeAdapter<'a, R, MAX_NODES, MAX_ENTITIES, MAX_CALLBACKS>
impl<'a, R, const MAX_NODES: usize, const MAX_ENTITIES: usize, const MAX_CALLBACKS: usize> UnsafeUnpin for NodeRuntimeAdapter<'a, R, MAX_NODES, MAX_ENTITIES, MAX_CALLBACKS>
impl<'a, R, const MAX_NODES: usize = { crate::node_metadata::DEFAULT_MAX_METADATA_NODES }, const MAX_ENTITIES: usize = { crate::node_metadata::DEFAULT_MAX_METADATA_ENTITIES }, const MAX_CALLBACKS: usize = { crate::node_metadata::DEFAULT_MAX_METADATA_CALLBACKS }> !UnwindSafe for NodeRuntimeAdapter<'a, R, MAX_NODES, MAX_ENTITIES, MAX_CALLBACKS>
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
Mutably borrows from an owned value. Read more